creating a library from haskell files and a c wrapper in Linux

Simon Marlow simonmar@microsoft.com
Tue, 10 Sep 2002 15:39:35 +0100


> tis 2002-09-10 klockan 16.08 skrev Martin Norb=E4ck:
> > Now I have done the following:
> >=20
> > # ghc -fglasgow-exts -c Adder.hs
> > # gcc -c -DDLL_IMPORT=3D -I/usr/lib/ghc-5.04/include dllMain.c
> > # ld -shared -o adder.so Adder.o Adder_stub.o dllMain.o
> > -L/usr/lib/ghc-5.04 -lHSbase -lHSbase_cbits -lHSrts -lHSbase -lgmp
> > # gcc test.c -L. -ladder
> > # env LD_LIBRARY_PATH=3D. ./a.out
> >=20
> > and then I get the following:
> >=20
> > a.out: fatal error: LOOKS_LIKE_GHC_INFO- is incorrectly defined
> >=20
> > What to do next, I wonder...
>=20
> Here are the files used so you can test for yourself. Oh, and adder.so
> above should be libadder.so.

You can't make a dynamic library containing Haskell code on Unix, sorry. =
 What actually is it you're trying to do?

Cheers,
	Simon