用下面的項目結構:生產從單個項目的多個可執行文件
src/FirstExecutable.hs
src/SecondExecutable.hs
my-amazing-project.cabal
和下面的小集團設置:
name: my-amazing-project
version: 0.1.0.0
build-type: Simple
cabal-version: >=1.8
executable first-executable
hs-source-dirs: src
main-is: FirstExecutable.hs
ghc-options: -O2 -threaded -with-rtsopts=-N
build-depends: base == 4.5.*
executable second-executable
hs-source-dirs: src
main-is: SecondExecutable.hs
ghc-options: -O2 -threaded -with-rtsopts=-N
build-depends: base == 4.5.*
運行cabal install
失敗,並輸出如下:
Installing executable(s) in
/Users/mojojojo/Library/Haskell/ghc-7.4.2/lib/my-amazing-project-0.1.0.0/bin
cabal: dist/build/second-executable/second-executable: does not exist
Failed to install my-amazing-project-0.1.0.0
cabal: Error: some packages failed to install:
my-amazing-project-0.1.0.0 failed during the final install step. The exception
was:
ExitFailure 1
我做錯了什麼,或者這是一個Cabal錯誤?是
所述可執行模塊的內容如下:
module FirstExecutable where
main = putStrLn "Running FirstExecutable"
和
module SecondExecutable where
main = putStrLn "Running SecondExecutable"
它適用於我。 – Satvik
@Satvik我剛剛發現瞭解決方案。發佈它 –
你不應該在可執行文件中使用'module ..'。或者你可以使用'模塊主' – Satvik