hi, i wrote some utilities to make my coding a little easier and i put them in some libraries. then to use them i made a package conf file and added it with ghc-pkg -a. i then tried compiling them with
ghc -package-name extensions -c Foo.hs
but i am not sure i am compiling it right as i get linker errors of the form
/usr/libexec/elf/ld: cannot find -lDirectoryAndExtensions
whenever i try to compile a program that uses my libraries.
I can't tell exactly what's wrong from this error message - what does your package conf file look like?
i can fix this by copying all the .o files to libFoo.a files. what is the right way to compile libraries?
You should make a lifFoo.a for static linking, and a single Foo.o for use with GHCi. The documentation on packages in the user guide explains how to do this. Cheers, Simon
participants (1)
-
Simon Marlow