[fpc-pascal] Statically link library
ludo.brands at free.fr
Wed Apr 24 10:00:00 CEST 2013
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.
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 ;)
More information about the fpc-pascal