[fpc-pascal] Mangle name in fpc-FreeBSD ?

Marco van de Voort marcov at stack.nl
Sat Mar 19 20:53:59 CET 2016

In our previous episode, Ewald said:
> > Re-huh..., it should be a great plus if a dlerror() was implemented in fpc
> > too.
> >
> > But maybe I am missing something, maybe dlopen(), dlsym() and dlerror() can
> > be done by pascal code (and not via console, like I try).
> >
> dlopen, dlsym and dlerror are *functions*, not console commands. Well, I
> never tried the latter, but it appears they are not on your system ;-)
> Now, I don't know where exactly these functions are declared (in which
> unit, that is), but for debugging purposes, just add
>     Function dlopen(filename: PChar; flags: cint): Pointer; cdecl; external;
>     Function dlclose(handle: Pointer): cint; cdecl; external;
>     Function dlsym(handle: Pointer; Name: PChar): Pointer; cdecl; external;
>     Function dlerror: PChar; cdecl; external;
> Somewhere in your code before you call them.

... or use unit dl.

More information about the fpc-pascal mailing list