
12 Oct
2000
12 Oct
'00
5:07 a.m.
Greetings -
Could someone instruct me on (or point me to) the correct ghc command line for calling haskell from C? From the documentation, it seems like "ghc -fglasgow-exts -no-hs-main main.c foo.hs" should work, but that still gives me a multiple definition of "main".
I'm running ghc 4.08.1 on Windows NT.
You can use ghc just like you would use gcc to compile up your C program, then use ghc again to link the whole program with the Haskell module(s). The -no-hs-main flag shouldn't be necessary, as far as I can tell. eg. $ ghc -c main.c $ ghc -c HaskellStuff.hs $ ghc main.o HaskellStuff.o Cheers, Simon
8988
Age (days ago)
8988
Last active (days ago)
0 comments
1 participants
participants (1)
-
Simon Marlow