Problem exporting Haskell to C via a DLL in GHC 6.6

Simon Marlow simonmarhaskell at
Wed Feb 7 06:56:45 EST 2007

SevenThunders wrote:

> Another question I have is, is it possible to create a statically linked
> Haskell library that can be linked using MS VC tools?  Also I must say I am
> a bit confused about the use of the routine __stginit_Bad.  Suppose I had
> multiple Haskell modules each with their own functions to export.  Which
> __stginit_??? routine do I use?

For each module, you invoke this function:

    void hs_add_root (void (*init_root)(void));

which you can get from HsFFI.h.  eg.


and you do this after calling hs_init().


More information about the Glasgow-haskell-users mailing list