GHC 6.4.1 and Win32 DLLs: Bug in shutdownHaskell?

Cyril Schmidt cschmidt at deds.nl
Fri Mar 3 07:27:51 EST 2006


Michael,

> - How to generate an import library at all?
Check this out:
http://www.haskell.org/haskellwiki/GHC/FAQ#How_do_I_link_Haskell_with_C.2B.2B_code_compiled_by_Visual_Studio.3F

> - 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?
See above.

> - 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.
I could not make Visual Studio 7 understand those, but I didn't try really
hard.

> - Didn't you have problems with mangled names?
Haskell would not understand mangled names.
You have to declare the Haskell functions
as extern "C" in the C++ code.

This, of course, does not count for functions that are passed to/from
Haskell via a function pointer.

> - 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?
I don't know :(

Just one more piece of advice: if you can compile your C++ code with gcc,
you probably can link it statically to the Haskell code, thus avoiding this
DLL nightmare.

Hope this helps.

Cheers

Cyril






More information about the Glasgow-haskell-users mailing list