newLISP and windows DLLs

Q&A's, tips, howto's

newLISP and windows DLLs

Postby ryuo » Fri Jun 06, 2014 10:01 am

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)
ryuo
 
Posts: 43
Joined: Wed May 21, 2014 4:40 pm

Re: newLISP and windows DLLs

Postby Lutz » Fri Jun 06, 2014 1:59 pm

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?
Lutz
 
Posts: 5276
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: newLISP and windows DLLs

Postby ryuo » Fri Jun 06, 2014 6:28 pm

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.
ryuo
 
Posts: 43
Joined: Wed May 21, 2014 4:40 pm


Return to newLISP in the real world

Who is online

Users browsing this forum: No registered users and 1 guest

cron