Page 1 of 1

newLISP and windows DLLs

Posted: Fri Jun 06, 2014 10:01 am
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)

Re: newLISP and windows DLLs

Posted: Fri Jun 06, 2014 1:59 pm
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?

Re: newLISP and windows DLLs

Posted: Fri Jun 06, 2014 6:28 pm
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.