newLISP and windows DLLs

Q&A's, tips, howto's
Post Reply
ryuo
Posts: 43
Joined: Wed May 21, 2014 4:40 pm

newLISP and windows DLLs

Post by ryuo »

I have tried to get newLISP to load a libnewt.dll, but the interpreter has issues upon exit. It seems to happen when the DLL is unloaded. The entire DLL was compiled by GCC 4.8.1 from the mingw32 build system. Any ideas?

The error is like so:
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

The import code is below. As for the DLL, it can be found here: https://github.com/ryuo/newlisp-newt/ra ... ibnewt.dll

Code: Select all

(import "libnewt.dll" "newtGetScreenSize" "void" "void*" "void*")
(exit 0)

Lutz
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: newLISP and windows DLLs

Post by Lutz »

Have not seen this with other DLLs. May be you have to import and call some special clean-up functions for that library? It may allocate resources which have to be released explicetely?

ryuo
Posts: 43
Joined: Wed May 21, 2014 4:40 pm

Re: newLISP and windows DLLs

Post by ryuo »

I didn't think this would be an issue as C has very limited mechanisms for automated functions compared to C++, but I found a solution. I checked the DLL's dependency list, and noted that DLLs without libgcc seemed to work just fine. I tried linking with libgcc statically and newLISP no longer has any issues upon exit. Thanks.

Post Reply