Quote from: Bitbeisser on February 13, 2014, 10:50:24 PM
Quote from: JimJoyce on February 12, 2014, 07:16:31 PM
I'm fairly new. I learnt (and taught) C some 20 years ago,
I tried Pelles-C about a year ago, but got nowhere.
I'm trying again. I've converted about 300 lines of JS script into C,
but after finally getting a clean compile, when I try to execute
POLINK gives me 38 unresolved externals.
I'm sure there's a simple explanation, but where to find if ?
Thanks, in advance,
JJ
As Timo already mentioned, the list of those externals is likely leading to the explanation. Most likely, you just need to include some appropriate header files into your source code. But as nobody around here is in possession of a working crystal ball, providing that list of unresolved externals would be needed to help you out...
Ralf
I simply clicked the 'compile' option.
I added no conditions.
This is the list of missing externals:
Building hex.exe.
POLINK: warning: Invalid machine type in object 'C:\JData\CProgs\output\hex.obj'.
POLINK: warning: Invalid machine type in object 'crt.lib(fopen.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(printf.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(exit.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(puts.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_stoul.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(fprintf.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(fputs.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_ftol.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_fslot.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_fopen.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(fwrite.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_files.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_stbuf.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_printf.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_exit.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(fputc.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_ctypetab.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_tolowertab.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(memchr.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(errno.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_fwrite.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(strrchr.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_fflush.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(malloc.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(__fopen.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(fclose.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(isatty.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_mbtowc.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(strchr.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_putfield.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_puttxt.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(write.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_getmem.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(free.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_crt0dat.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_bigheap.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(open.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_atexit.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(close.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(remove.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_ioinit.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_state.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(__mbtowc.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_putstr.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_litob.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_fptestl.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_ldtob.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(constraint_handler_s.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(lseek.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_osfinfo.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_cp2cp.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_maperr.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(memcpy.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(read.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(chsize.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(abort.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(unlink.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_wctomb.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_ullmod.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_ulldiv.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_lldiv.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_llmul.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_fptest.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_fpunscalel.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_fpscalel.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_ftoll.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_genld.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(ldiv.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_strerror.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_chkstk.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(features.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(calloc.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(setmode.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(raise.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(__wctomb.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_fpunscale.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_fpscale.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(localeconv.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(div.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(memset.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(signal.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_fpnorm.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_values.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_crt0.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(seh2.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(seh1.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_heapsz.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(clock.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_setargv.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_setenvp.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_initex.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_xcptfilter.obj)'.
POLINK: warning: Invalid machine type in object 'crt.lib(_dflheap.obj)'.
POLINK: error: Unresolved external symbol '__imp__ExitProcess@4'.
POLINK: error: Unresolved external symbol '__imp__GetConsoleMode@8'.
POLINK: error: Unresolved external symbol '__imp__GetConsoleOutputCP@0'.
POLINK: error: Unresolved external symbol '__imp__WriteFile@20'.
POLINK: error: Unresolved external symbol '__imp__GetLastError@0'.
POLINK: error: Unresolved external symbol '__imp__VirtualAlloc@16'.
POLINK: error: Unresolved external symbol '__imp__VirtualQuery@12'.
POLINK: error: Unresolved external symbol '__imp__HeapCreate@12'.
POLINK: error: Unresolved external symbol '__imp__HeapDestroy@4'.
POLINK: error: Unresolved external symbol '__imp__HeapAlloc@12'.
POLINK: error: Unresolved external symbol '__imp__HeapReAlloc@16'.
POLINK: error: Unresolved external symbol '__imp__HeapFree@12'.
POLINK: error: Unresolved external symbol '__imp__HeapSize@12'.
POLINK: error: Unresolved external symbol '__imp__HeapValidate@12'.
POLINK: error: Unresolved external symbol '__imp__CreateFileA@28'.
POLINK: error: Unresolved external symbol '__imp__GetFileType@4'.
POLINK: error: Unresolved external symbol '__imp__CloseHandle@4'.
POLINK: error: Unresolved external symbol '__imp__GetStartupInfoA@4'.
POLINK: error: Unresolved external symbol '__imp__GetStdHandle@4'.
POLINK: error: Unresolved external symbol '__imp__GetCurrentProcess@0'.
POLINK: error: Unresolved external symbol '__imp__DuplicateHandle@28'.
POLINK: error: Unresolved external symbol '__imp__SetHandleCount@4'.
POLINK: error: Unresolved external symbol '__imp__MultiByteToWideChar@24'.
POLINK: error: Unresolved external symbol '__imp__SetFilePointer@16'.
POLINK: error: Unresolved external symbol '__imp__SetStdHandle@8'.
POLINK: error: Unresolved external symbol '__imp__WideCharToMultiByte@32'.
POLINK: error: Unresolved external symbol '__imp__ReadFile@20'.
POLINK: error: Unresolved external symbol '__imp__GetConsoleCP@0'.
POLINK: error: Unresolved external symbol '__imp__SetEndOfFile@4'.
POLINK: error: Unresolved external symbol '__imp__DeleteFileA@4'.
POLINK: error: Unresolved external symbol '__imp__SetConsoleCtrlHandler@8'.
POLINK: error: Unresolved external symbol '_RtlUnwind@16'.
POLINK: error: Unresolved external symbol '__imp__GetSystemTimeAsFileTime@4'.
POLINK: error: Unresolved external symbol '__imp__GetCommandLineA@0'.
POLINK: error: Unresolved external symbol '__imp__GetModuleFileNameA@12'.
POLINK: error: Unresolved external symbol '__imp__GetEnvironmentStrings@0'.
POLINK: error: Unresolved external symbol '__imp__FreeEnvironmentStringsA@4'.
POLINK: error: Unresolved external symbol '__imp__UnhandledExceptionFilter@4'.
POLINK: fatal error: 38 unresolved external(s).
*** Error code: 1 ***
Done.
Thanks, all, for your help.
JJ
You must create a project first if you are unfamiliar with switches needed to compile executables.
Try again:
File->New->project this will open the project wizard where you can choose a templete project or an empty project of the kind you need (consolle, GUI, static or dynamic lib).
Choose a directory where hold the project files and go...
The wizard will set all the appropriate switches for you.
P.S. if in your project you go to project->project options and under the compiler tab select MS extensions many errors will go away ;)
Thanks, everyone.
I'm now compiling fairly cleanly, just getting one warning:
Function 'main' can't be __fastcall, changed to __cdecl.
Not sure what that means. But it executes OK.
I say 'OK', but I'm starting a new thread with new problem.
Just wanted to add my two cents.
I got very similar error messages because I created a 64 Windows console project then decided I wanted to switch to 32 bit. I just went into the project options and changed everything I could find from 64 to 32. When I tried to compile or build I got the POLINK external errors.
By saving the source somewhere else and creating a new project from the beginning as 32 bit console and then adding in the source, I was able to compile and build with no problems.
Cheers!
So LIB path was wrong.
Project options -> Macros is good place to check those ;)