Defect #661
openRunning of dynamic library functions through Windows API fails
0%
Description
I ported directly some code I have used with the XDS compiler which loads the Sqlite dll at runtime trough the Windows API LoadLibraryA and GetProcAddress functions. (I see the corresponding Linux/BSD functions is currently not available)
It compiles OK and seems to correctly load the DLL and find the functions, but I get a segmentation fault when
calling the loaded procedure.
Attached is the (reduced) code and it expect the 'sqlite3.dll' in the local path in order to work.
This maybe has something to do with calling convention difference between Oberon and Windows?
Files
Updated by Florian Negele about 1 year ago
Calling dynamically-loaded functions is not supported at the moment. The problem is indeed the different calling convention. You could try and statically link against this library. The files runtime/winsdl.cpp
and libraries/oberon/api.sdl.mod
should give you a basic idea.
Updated by Runar Tenfjord about 1 year ago
Thanks for your prompt response.
I will have a look at the referenced files for a workaround.