DLL import failing

Q&A's, tips, howto's

DLL import failing

Postby dexterlagan » Mon Jul 16, 2018 2:14 pm

Hi folks,

First post ever. I'm attempting to compile the Genann neural network library into a DLL for import into newLISP.

https://github.com/codeplea/genann

I updated the C source and its header to comply with either STDCALL or CDECL conventions (tried both with no success). I tried several methods to output a DLL out of the C source, which all work fine except when importing in newLISP. The methods I tried are described here :

https://www.transmissionzero.co.uk/comp ... ith-mingw/

I checked the exports using Dependency Walker, and all functions are exported correctly (at least when using CDECL, somehow the STDCALL one still showed up as a C export.
No matter what I do newLISP returns the usual import error when attempting to import the DLL :

ERR: problem loading library in function import : "genann.dll"

My import line :

(import "genann.dll" "genann_init") (when stdcall)
or
(import "genann.dll" "genann_init" "cdecl")

I tried using the absolute path (with slashes) to the DLL, as well as both calling conventions, to no avail.
I tried compiling the DLL both with gcc straight to DLL (-shared etc.) and through mingw's dllwrapper, to the same result. The DLL file I'm getting seems legit, and I have no problem importing it from C.

Has anybody encountered this problem?

Thanks in advance!

Dexter
dexterlagan
 
Posts: 1
Joined: Sun Jul 15, 2018 1:54 pm

Return to newLISP in the real world

Who is online

Users browsing this forum: No registered users and 2 guests

cron