[fpc-pascal]dll (with c convention) under win and linux

Sebastian G√ľnther sguenther at gmx.de
Sun Oct 29 18:47:23 CET 2000

Alexis Halbot-Schoonaert wrote:
> ./dlltest: error in loading shared libraries:
> libtestdll.so: cannot open shared object file:
> No such directory
> Though, libtestdll.so is in the same directory than dlltest. I tried to
> copy libtestdll.so in /usr/sbin, and i have the same problem. So,
> supposed it was not because of the path...

Not if you didn't run 'ldconfig' after copying the .so to /usr/sbin...
[BTW, you should use /usr/local/bin or /usr/local/sbin instead...]

> And i'd like the main program and the library to use the c call
> convention (with cdecl ?). What is the way to do it ?

Attention, this is not the default on Win32. Win32 libraries normally
use 'stddecl' conventions. On Linux, cdecl is standard, of course.

> program dlltest;
> procedure p1(x:pointer); external 'testdll' name 'P1';

procedure p1(x:pointer); cdecl; external 'testdll' name 'P1';

and so on

- Sebastian

More information about the fpc-pascal mailing list