Reputation: 833
No binary is produced when I ghc -O2 --make Test.hs
, but only the .o and .hi files.
Test.hs contains a main :: IO ()
function and has module name Test
.
Is the linker not behaving? How can I fix this? I'm using GHC 7.8.3 on OSX, have Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) Target: x86_64-apple-darwin13.4.0
Thank you in advance for any hints
Upvotes: 1
Views: 66
Reputation: 24802
Your problem is the module name. GHC expects a function named main
in a module named Main
as a default. You can override this with the -main-is
option. As in
ghc -O2 -main-is Test --make Test.hs
Upvotes: 5