[Haskell-cafe] FFI question

Frederico Franzosi ffranzosi at gmail.com
Wed Feb 8 21:08:12 EST 2006


I'll try to make it short.

I'm developping a package wich imports C functions.

the fact is that when I try to compile if I call the compiler in the
usual way, using -package and -llib it gives an undefined reference
error...

For example if I use:
$ghc -package PKGname-PKGversion -fffi -o main Main.hs -llib

it gives an error message (undefined references of objects from PKG to
functions in lib)


but if I use:

$ghc -fffi -o main Main.hs -llib /path/to/PKGlib.a

it compiles correctly.


and also when I do:

$ghc -package PKGname-PKGversion -fffi -o main Main.hs /path/to/lib.a

it compiles correctly.


I know that it is surely my mistake but I didn't find anything helpful
in docummentation or in FFI list. I know that I should send this
message to ffi mailing list but it is kind of stopped and I think I'll
get my answers here...

Thank you for the atention.


More information about the Haskell-Cafe mailing list