[fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()
Fred van Stappen
fiens at hotmail.com
Fri Jan 17 15:16:36 CET 2014
Hello.
Thanks to Mister Hinst, i was able to load and run, in Windows, with dynlib.pas, SoundTouch.dll. Perfect and re-thanks.
Now, i begin a other hard battle : load and run in Linux, libSoundTouch.so.
With the extremely helpful message of Mister Ewald :> Try to find the names of the symbols defined in the shared object (nm comes to mind).
I run nm and find the name of the procedures ( PS : without nm-Ewald's tip, you must be a high soothsayer to find it)
For example, a C called procedure : soundtouch_getVersionString() becomes : _ZN10soundtouch10SoundTouch16getVersionStringEv() !!!
And, believe it or not... it works...
I have only a problem with one procedure:
This c procedure is declared as this :
SOUNDTOUCHDLL_API void __cdecl soundtouch_setSampleRate(HANDLE h, unsigned int srate);
And i translate it like that :
soundtouch_setSampleRate : procedure(h : THandle; srate : cardinal); cdecl;
and for dynamic-loading :
Pointer(soundtouch_setSampleRate):= GetProcAddress(LibHandle, Pchar('_ZN10soundtouch10SoundTouch13setSampleRateEj'));
Sadly i get that message when i try to load that procedure :
An unhandled exception occurred at $00007F7D76D61AE8:
EAccessViolation: Access violation $00007F7D76D61AE8
(program exited with code: 217)
Does somebody have some light for this ?
Many thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140117/8dfbd9ed/attachment.html>
More information about the fpc-pascal
mailing list