Hello,
 
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?

Thx

 

Dominik