[fpc-pascal] How to call lib routines with cdecl calling convention with win32 app?

Marco van de Voort marcov at stack.nl
Sat May 30 11:55:38 CEST 2009


In our previous episode, Coco Pascal said:
> I have a library with udf routines using the cdecl calling convention, 
> required by Firebird. This seems to work well on win32.

How exactly?

> However when I test these routines with a fpc win32 app declaring 
> external functions with the cdecl or stdcall calling convention gives me 
> a 'entrypoint not found' error. I assume cdecl is obligatory, but can I 
> implement that?

Maybe it is a matter of an underscore prefix. Write the declaration full
(cdecl external libname name '_symbol';

and experiment with leaving the underscore there or not.

It might also be the need to declare a libname. Windows and OS X afaik have separate
linker namespaces for external libs, so you need to declare the name of the
module they are in.



More information about the fpc-pascal mailing list