[fpc-pascal] Nano-x

Marco van de Voort marcov at stack.nl
Thu Jul 20 11:30:32 CEST 2006

> On Thu, 20 Jul 2006, Marco van de Voort wrote:
> >>
> >> You need to link to the C library as well.
> >>
> >> So, add
> >>
> >> {$linklib c}
> >
> > _Never_ add linklib c or linklib gcc directly, always work via unit initc.
> > That's what it is for.
> I thought the compiler did this automatically when it detects a link to 
> the C library ?

Not that I know. It mostly is useful so that you don't have to change
seventy headers if the name of libc changes on some platform, to potentially
polish away issues with dependancies on certain sublibraries
(libdl,libgettext,libgcc), and to encapsulate libc errno access.

There shouldn't be a {$linklib C or linklib gcc in any unit. _always_ via
unit initc.

More information about the fpc-pascal mailing list