I'm running the default installation of Haskell platform on Ubuntu and when I run this example http://www.haskell.org/haskellwiki/Calling_Haskell_from_C "ghc -c -O Safe.hs" is not producing the Safe_stub.o file. I have checked this on a separate installation of Ubuntu on a friends box and on both 32 bit and 64 bit Ubuntu installs.
Can somebody confirm if this is specific to ghc-7.4.1 or Ubuntu installs only?
Thanks!
It's a ghc-7.4 (ghc >= 7.2
actually) thing. That doesn't need and produce *_stub.o
(or *_stub.c
) files anymore. However, the command line for the final compilation has to change
$ ghc -no-hs-main -optc-O test.c Safe.o -o test
You have to tell GHC that the main
is not a haskell call.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With