Problem exporting Haskell to C via a DLL in GHC 6.6
mattcbro at earthlink.net
Tue Feb 6 14:23:07 EST 2007
Simon Marlow-5 wrote:
> I wonder if you're hitting this bug:
> if so, it's slightly worrying that the same thing happens if you just link
> program directly to the DLL, rather than loading it explicitly.
No doubt it is the same bug. Moreover I think even a 'direct' link to a DLL
has to call some interface code that loads the DLL in the standard way
during initialization. Interestingly if I follow Brian's advice and remove
the shutdownHaskell call in the dllMain routine, the 'hang' goes away.
Unfortunately, however, if I do this, then whenever I use the code inside
Matlab and decide to clear the mex function, the dll gets unloaded and
Matlab crashes. Perhaps I can expose the unloadHaskell function in some
form for use in Matlab, or perhaps I should go with the Begin() and End()
approach suggested earlier. I'll have to give this some thought since I use
my library both inside and outside the Matlab environment.
View this message in context: http://www.nabble.com/Problem-exporting-Haskell-to-C-via-a-DLL-in-GHC-6.6-tf3179123.html#a8832467
Sent from the Haskell - Glasgow-haskell-users mailing list archive at Nabble.com.
More information about the Glasgow-haskell-users