我剛剛安裝了一個新的Haskell版本:HaskellPlatform-8.0.1-minimal-x86_64-setup-a, 我需要包MissingH,它需要包網絡。 但是CABAL安裝網絡收益率:未通過cabal安裝MissingH和Windows上的網絡
$ cabal install network
Resolving dependencies...
cabal: Entering directory 'C:\cygwin64\tmp\cabal-tmp-6136\network-2.6.2.1'
Configuring network-2.6.2.1...
configure: WARNING: unrecognized options: --with-compiler
checking build system type... x86_64-unknown-cygwin
checking host system type... x86_64-unknown-cygwin
checking for gcc... C:\PROGRA~1\HASKEL~1\802E01~1.1\mingw\bin\gcc.exe
checking whether the C compiler works... no
configure: error: in `/tmp/cabal-tmp-6136/network-2.6.2.1':
configure: error: C compiler cannot create executables
See `config.log' for more details
cabal: Leaving directory 'C:\cygwin64\tmp\cabal-tmp-6136\network-2.6.2.1'
Failed to install network-2.6.2.1
cabal.exe: Error: some packages failed to install:
network-2.6.2.1 failed during the configure step. The exception was:
ExitFailure 77
首先,我試圖啓動Cygwin的命令窗口以管理員身份,但這並沒有解決問題。 於是,我跟着stack cannot build network - where's config.log?
在使用堆棧產量的成功, 雖然要運行堆棧設置
$ stack build
Compiler version mismatched, found ghc-8.0.1 (x86_64), but expected minor version match with ghc-7.10.3 (x86_64) (based on resolver setting in C:\tmp\network-2.6.2.1\stack.yaml).
Try running "stack setup" to install the correct GHC into C:\Users\<username>\AppData\Local\Programs\stack\x86_64-windows\
堆棧設置,組構造後
安裝,我得到:
$ stack test
network-2.6.2.1: test (suite: regression)
testGetAddrInfo: [OK]
Test Cases Total
Passed 1 1
Failed 0 0
Total 1 1
network-2.6.2.1: test (suite: simple)
Basic socket operations:
testSend: [OK]
testSendAll: [OK]
testSendTo: [OK]
testSendAllTo: [OK]
testSendMany: [OK]
testSendManyTo: [OK]
testRecv: [OK]
testOverFlowRecv: [OK]
testRecvFrom: [OK]
testOverFlowRecvFrom: [OK]
testUserTimeout: [OK]
Test Cases Total
Passed 11 11
Failed 0 0
Total 11 11
然而,我仍然不能繼續MissingH。實際上,它仍然試圖安裝網絡!
$ cabal install MissingH
Resolving dependencies...
cabal: Entering directory 'C:\cygwin64\tmp\cabal-tmp-5596\network-2.6.2.1'
Configuring network-2.6.2.1...
configure: WARNING: unrecognized options: --with-compiler
checking build system type... x86_64-unknown-cygwin
checking host system type... x86_64-unknown-cygwin
checking for gcc... C:\PROGRA~1\HASKEL~1\802E01~1.1\mingw\bin\gcc.exe
checking whether the C compiler works... no
configure: error: in `/tmp/cabal-tmp-5596/network-2.6.2.1':
configure: error: C compiler cannot create executables
See `config.log' for more details
cabal: Leaving directory 'C:\cygwin64\tmp\cabal-tmp-5596\network-2.6.2.1'
Failed to install network-2.6.2.1
我也試過:http://neilmitchell.blogspot.nl/2010/12/installing-haskell-network-library-on.html這是在GHC 6.12.3和7.0.1測試(而不是在新的8.0.1版本)。 不幸的是,我得到的錯誤:
getEnv: invalid argument (The operation completed successfully.)
只是爲了保持完整性,我的陰謀版本:
$ cabal -V
cabal-install version 1.24.0.0
compiled using version 1.24.0.0 of the Cabal library
我缺少的是安裝網絡和MissingH?
堆棧將組件安裝到〜/ .stack/snapshots/...這不是cabal尋找東西的地方。也許你最好爲你的工作創建一個.cabal文件並使用堆棧來構建它。教程可用[這裏](https://github.com/commercialhaskell/stack/blob/master/doc/GUIDE.md#hello-world-example) – ErikR