Using GHC and FFI

Dominik Oesterreich dominik at
Thu Jul 15 14:15:27 EDT 2004

I try to use the FFI, but it doesn't work.
I write:
int test (void)
    return 2;
and compiled this. So I created a file named project.obj.
Then I wrote a Lhs File named test.lhs
>module Blah where

>import Foreign.C.Types(CInt)
>foreign import ccall test :: CInt

>blah = test


After that I wrote ghc -fffi -c test.lhs. But when I call blah from ghci
I get the error message: "test.o unknown symbol '_test'

I think ghc doen't link test.o to projekt.obj. What do I have to do? 




-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Glasgow-haskell-users mailing list