我创建了一个非常简单的程序:
module CompileTest(main) where
main = putStrLn "Hello, World!"
Run Code Online (Sandbox Code Playgroud)
当我尝试使用以下方法编译它时ghc CompileTest.hs:
/usr/lib/ghc-6.12.1/libHSrtsmain.a(Main.o): In function `main':
(.text+0x10): undefined reference to `ZCMain_main_closure'
/usr/lib/ghc-6.12.1/libHSrtsmain.a(Main.o): In function `main':
(.text+0x18): undefined reference to `__stginit_ZCMain'
Run Code Online (Sandbox Code Playgroud)
有谁知道这是什么?我没有做任何复杂的事情.它在GHCi中运行良好.