[Haskell-cafe] FFI question

Christopher Brown cmb21 at kent.ac.uk
Thu Feb 9 04:45:49 EST 2006


Frederico,

Have you tried using Green Card?

http://haskell.org/greencard/

It is basically a foreign function pre-processor for Haskell. It  
allows your Haskell programs to interface with C libraries in a very  
straight forward way.


Chris.


On 9 Feb 2006, at 02:08, Frederico Franzosi wrote:

> 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.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

Christopher Brown
Ph.D. Student University of Kent. UK.
http://www.cs.kent.ac.uk/people/rpg/cmb21/index.html





More information about the Haskell-Cafe mailing list