Building Win32 DLLs: Manual is not up-to-date

Michael Marte marte at
Mon Feb 27 12:46:37 EST 2006

Hello *,

I am trying to turn a prototype written in Haskell into something
I can call from a Visual Studio C++ 6.0 program. (The prototype is
so clean and fast that there is no point in recoding everything.)
So I followed the instructions in section 11.5 of the ghc manual
("Building and using Win32 DLLs") and ended up as follows:

$ ghc -c dllMain.c
dllMain.c:4: warning: type defaults to `int' in declaration of `EXTFUN'
dllMain.c:4: warning: parameter names (without types) in function 
dllMain.c:4: warning: data definition has no type or storage class
dllMain.c: In function `DllMain':
dllMain.c:18: error: `__stginit_Adder' undeclared (first use in this
dllMain.c:18: error: (Each undeclared identifier is reported only once
dllMain.c:18: error: for each function it appears in.)

Section 8.2 proposes to add

extern void __stginit_Adder(void)

which actually works.

So it seems that section 11.2 is not up-to-date!

More information about the Glasgow-haskell-users mailing list