[fpc-pascal] Underscore prefix for external C functions

Adriaan van Os fpc at microbizz.nl
Fri Sep 7 12:54:01 CEST 2007

I am trying to find out whether or not to use an underscore prefix when declaring external C 
functions in FPC using 'external name  xxx'. It looks like on Windows the underscore is not needed, 
whereas on Mac OS X the underscore is required, even when on both platforms 'nm' reveals that the 
to-be-linked-in C library has an underscore before the C function names.

Note that the Mac OS X Pascal (Carbon) Interfaces for fpc use the underscore, whereas the same 
Pascal Interfaces for gpc don't.

Is this just a mess or do I miss the true logic behind it ?


Adriaan van Os

More information about the fpc-pascal mailing list