GHC 6.4.1 and Win32 DLLs: Bug in shutdownHaskell?

Michael Marte marte at
Fri Mar 3 05:10:14 EST 2006


- How to generate an import library at all? Section 11.5.1 of the ghc 
manual says that the --mk-dll option will cause ghc to create such a 
library, but ghc 6.4.1 does not do this, at least not on Windows. Or did 
you use the Microsoft lib.exe? (lib.exe /def Foo.def generates an import 
library from the DLL but I have no idea how use it. After all, lib.exe 
does not have any type information on the symbols exported by the DLL, 
so how is this is supposed to work?)

- Assuming I have obtained an import library, how to use in the 
Microsoft world, i.e.
how to bridge the gap from .a to .lib?

- Is Visual Studio 7 able to process the header files included from the 
stub header files generated by ghc? Visual Studio 6 has a lot of 
problems, e.g. it knows nothing about the type long long.

- Didn't you have problems with mangled names?

- What is the principal difference between using the import library and 
writing one on my own? Does the import library do anything else than 
loading the library and delegating the calls?

It would be great if you could give me a recipe (in terms of a 
shell-command sequence) that demonstrates how you achieved your goal!


BTW. If I learn anything from this thread that is not yet contained in 
the Haskell Wiki page pointed to by Simon, I will add it.

Cyril Schmidt wrote:

> Did you try to link the DLL statically (i.e. via import library) and
> remove the call to shutdownHaskell() ?
> It worked for me (I am using Visual Studio 7, though).
> Cheers,
> Cyril

More information about the Glasgow-haskell-users mailing list