[fpc-pascal] $LINKLIB MSVCRT on windows/osx

Marco van de Voort marcov at stack.nl
Sun Mar 9 21:22:46 CET 2014


In our previous episode, md at rpzdesign.com said:
> Based on the tone of your response, I am thinking that I
> am doing something stupid on windows win32?

Not really. You are just asking C questions in a Pascal list :-)
 
> Should I be using Microsoft compiler to build  ceecodelib.a? (Instead of 
> Mingw 4.7x)

No, but you should get the relevant libs from that mingw compiler that you
used.

> This error shows up in the linker for freepascal as:
> 
> Error: Undefined symbol: _GetTickCount at 0
> 
> So that is what I am trying to get rid of, all the unresolved references 
> by telling the linker where to find the function
> without having to manually put a function GetTickCount : DWORD; cdecl ; 
> external name 'Kernel32.dll' ; in a pas file for every unresolved reference.

If you link the .a library in C, you must provide a whole bunch of -l
options on the gcc cmdline.

It is those options (and the corresponding .a files from the mingw
distribution you used) you must provide here. 
 
> Just easier with {$LINKLIB kernel32}, except the compiler spits out:

> Error: Import library not found for kernel32.  (Yikes!)

FPC doesn't not need import libs. So you must provide those yourself from
the development system you used to create the .a. 



More information about the fpc-pascal mailing list