$ ghc -fffi Foo.o Foo_stub.o main.cpp
main.o(.text+0x22): In function `main':
main.cpp: undefined reference to `__stginit_Foo()'
main.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
In main.cpp, you need to define __stginit_Foo(void) like this:
extern "C" void __stginit_Foo(void);
Specifying the "C" linkage with prevent the compiler from looking for a name-mangled version of the function.
To fix the second problem, you need to shut off exception handling (specifying the -fno-exceptions option ought to do this. I don't know how to pass compiler option via ghc, though.
--
Rich
AIM : rnezzy
ICQ : 174908475
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users