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

Ewald ewald at yellowcouch.org
Sun Mar 20 14:22:34 CET 2016

On 03/20/2016 12:56 AM, fredvs wrote:
> Re-hello (and last for tonight).
> Yep, yep, yep.
> Replacing all GetProcedureAdress() with dlsym()

Uhm, are you sure about this? I always thought GetProcedureAddress
simply calls through to dlsym. If one works and the other doesn't, this
needs some more investigation I think?

Also, in you last example, quoted here:

Now with DynLibs:

procedure loadmylib(lib : pchar);
ap1: pointer;
hn : integer;
/// with dynlibs
hn := dynlibs.loadlibrary(Pchar(lib));

if hn <> 0 then
writeln('loadlibrary() is OK') else
writeln('loadlibrary() is NOT OK') ;

ap1 := getprocedureaddress(hn, Pchar('mp4ff_open_read');


if ap1 <> nil then
writeln('getprocedureaddress() is OK') else
writeln('getprocedureaddress() is NOT OK') ;


Could you add a "writeln(dlerror());" ate the "****INDICATED POSITION****"? 

Just curious about what is going on here...

PS: Why do you use "hn: Integer" instead of "hn: TLibHandle"? I don't know if it can be assumed that this handle will always be an integer (think, for example, pointer)? Just a thought.



More information about the fpc-pascal mailing list