[fpc-pascal] Statically link library

Darius Blaszyk dhkblaszyk at zeelandnet.nl
Thu Apr 25 23:15:00 CEST 2013


On Apr 24, 2013, at 10:00 AM, Ludo Brands wrote:

> On 04/23/2013 10:14 PM, Darius Blaszyk wrote:
>> 
>> 
>> Thanks Ludo! Works perfectly also here. However for my understanding. Why does MinGW find open, filesize etc? Is there some header file that "translates" these functions to be compatible with msvcrt? If not I would have to create one myself to limit the amount of work I guess.
>> 
> 
> Is MinGW finding open, filesize ? When building a static library there
> is no verification at all if functions really exist.
> Enter
> 	size = whatever(file);
> and build your static library. You don't get any errors. Only when
> linking the final executable it will start looking for 'whatever'.
> 
> In C you don't have to prototype functions. The compiler just assumes an
> extern int if the function is not defined in the source or an header
> file and leaves it up to the linker to sort it out. Or worse, lets your
> program crash if the function exists but has a different parameter list
> or does not return an int. Welcome to the joys of programming in C ;)
> 
Yes it does find them, the statically libraries are linked into an executable which works fine. That is why I was surprised. I'm sure MinGW must link to other libraries as well. The question though is which. Anyway to find out for a simple example project executable?

Regards, Darius




More information about the fpc-pascal mailing list