【发布时间】:2018-04-04 08:18:43
【问题描述】:
我写了一个简单的模块,叫做Test:
module Test (main) where
main =
putStrLn "Hello"
但是,当我尝试通过以下命令行编译它时:
ghc Test.hs -o my-program
我收到以下错误:
[1 of 1] Compiling Test ( Test.hs, Test.o )
<no location info>: error:
output was redirected with -o, but no output will be generated because there is no Main module.
【问题讨论】:
-
正如错误所说,没有主模块。你只有一个测试模块。