
29 Jul
2002
29 Jul
'02
6:27 a.m.
I'm just trying the ffi - importing some Haskell function into C. I've got a module "HelloWorld" with an exported function "add". And I got this "undefined reference" error while linking:
undefined reference to `HelloWorld_zdfadd_closure'
Can anybody please help me, what's wrong here?
A second problem is the __stginit... function. I've defined void __stginit_HelloWorld (void) {} with an empty body. Is this o.k.? Or should I make ghc to generate it for me somehow?
It sounds like you're not linking the Haskell module into the binary. The compiled Haskell code should provide both HelloWorld_zdfadd_closure and __stginit_HelloWorld. Cheers, Simon
8333
Age (days ago)
8333
Last active (days ago)
0 comments
1 participants
participants (1)
-
Simon Marlow