ghc packages for interactive use
Fri, 7 Sep 2001 10:55:39 +0100
> How can I configure a ghc package for use with ghci?
> what file does the linker try to load, and what is expected=20
> as contents?
For a Haskell library, the linker will attempt to load <lib>.o, where
the batch compiler would normally look for lib<lib>.a (on Unix). You
can construct <lib>.o from its constituent .o files using 'ld -r':
ld -r -o <lib>.o Foo.o Bar.o=20
or you can construct it from the .a library, like so:
ld -r -o <lib>.o --whole-archive lib<lib>.a
> is it libHSmypackage.so? do I have to set LD_LIBRARY_PATH manually?
For normal C code, you can either build a shared library or a combined
.o file as above. You don't need to use LD_LIBRARY_PATH - just tell
GHCi where the library lives using the package spec.