
Hi, I now can build ffihugs, and have added some patches so it finds visual studio etc. I'm currently have ffihugs do something "unexpected" - but I'm not sure what the real behaviour is... -- test.hs import Foreign import System.Environment main = print $ c_test 1 2 foreign import ccall unsafe "test.h test" c_test :: Int -> Int -> Int -- test.c int test(int a, int b){return 42;} -- test.h int test(int a, int b); Then I run (as per http://cvs.haskell.org/Hugs/pages/users_guide/ffihugs.html): ffihugs test.hs test.c And before compiling hugs has clobbered test.c, and removed my code from it. This gives a link error, since test is undefined. Is this how ffihugs is supposed to work? Should my code be going somewhere else? Thanks Neil

On Wed, Apr 26, 2006 at 05:29:57PM +0100, Neil Mitchell wrote:
ffihugs test.hs test.c
And before compiling hugs has clobbered test.c, and removed my code from it. This gives a link error, since test is undefined.
Is this how ffihugs is supposed to work? Should my code be going somewhere else?
It generates Foo.c from Foo.hs, so yes, you need to call your C file something else. I'll update the docs, as the example given there fails on a case-insensitive filesystem.
participants (2)
-
Neil Mitchell
-
Ross Paterson