1
中找到的名称我想要的是:cabal
构建我的模块; make
来构建这一个脚本。“请求的模块不同于在接口文件”
脚本链接到Objective-C(请参阅https://github.com/mchakravarty/language-c-inline/tree/master/tests/objc/marshal-array)。当我建立的脚本,它无法对进口:
$ make
Main.hs:1:1:
Bad interface file: dist/build/Commands/OSX/Events.hi
Something is amiss; requested module main:Commands.OSX.Events differs from name found in the interface file commands-0.0.0:Commands.OSX.Events
这里有一些文件的内容:
$ cat Makefile
PACKAGES = -package template-haskell -package language-c-quote -package language-c-inline -package commands
FRAMEWORKS = -framework Carbon -framework Cocoa -framework Foundation
LDFLAGS = $(PACKAGES) $(FRAMEWORKS)
Main: Main.o
cabal exec -- ghc -o Main Main.o $(LDFLAGS)
Main.o:
cabal build
cabal exec -- ghc -c Main.hs -idist/build/ -v
...
$ cat commands.cabal
exposed-modules: Commands.OSX.Events
hs-source-dirs: sources
...
$ ghc --show-iface dist/build/Commands/OSX/Events.hi
interface commands-0.0.0:Commands.OSX.Events 7083
...
$ cat sources/Commands/OSX/Events.hs
module Commands.OSX.Events where
...
$ cat Main.hs
import Commands.OSX.Events
...
小集团构建成功,并且可执行编译和运行成功,如果我只是把一切在同一个目录中,并忽略cabal。
我可以告诉GHC某些模块是某个包的一部分吗?
我可以制作cabal可执行文件,这些外部依赖关系吗?
其他解决方案?
http://meta.stackexchange.com/questions/17845/etiquette-for-answering-your-own-question – 2014-10-06 02:38:04