
13 Sep
2005
13 Sep
'05
11:45 a.m.
On 9/13/05, Felix Breuer
$ 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