我有一个src
目录。在这个目录中我有Main.hs
文件和Test
目录。在里面Test
我有的目录Test.hs
模块。我需要用 cabal 来编译它。
在我的阴谋集团文件中,我有:
Executable main
-- .hs or .lhs file containing the Main module.
Main-is: src/Main.hs
and
-- Modules not exported by this package.
Other-modules: Test.Test
当我做cabal configure
没关系,但是当我尝试时cabal build
我收到以下错误:
cabal build
Preprocessing executables for main-0.0.1...
cabal: can't find source for Test/Test in ., dist/build/autogen
我怎样才能正确构建Main.hs
和其他一些目录.hs
files?
谢谢。
If Test.Test
定义于src/Test/Test.hs
, 你需要
hs-source-dirs: src
在 Cabal 文件的可执行文件部分。请注意,您的main-is
文件路径应该相对于源目录,因此在这种情况下,您应该将其更改为Main.hs
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)