[Haskell-cafe] Re: Cabal and linking with static libs (.a files)

Ketil Malde ketil+haskell at ii.uib.no
Mon Jun 12 09:50:15 EDT 2006


Ketil Malde <ketil+haskell at ii.uib.no> writes:

>> But it's quite easy: just copy the .a files from /usr/lib (or
>> wherever) and put them in the same place as your libHSpackage.a.

> I managed to get it to work by following that advice, and also
> renaming foo.a to libfoo.a, and linking with -lfoo.

Now you see it, now you don't. :-/

* .a files in /local/lib/foo-0.0/ghc-xxxx/  -- check
* .a files named libfoo.a                   -- check
* -lfoo on the command line                 -- check

Using strace shows that the .a file is indeed being read by ghc, but I
still get "undefined reference".

Apologies for being dense, but I can't seem to make it work at all.
Is there a cabalized library that does this (links to a .a type C
library) that I can look at?

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants



More information about the Haskell-Cafe mailing list