无法安装cabal-install(v.1.22.0.0)

时间:2015-02-18 22:29:39

标签: haskell cabal-install

无法在Windows命令提示符和Cygwin64终端中安装cabal-install(v.1.22.0.0)。

与Windows一样,cabal无法更新cabal-install。我使用Haskell Platform 2014.2.0.0。

实际阴谋版本:

$ cabal -V
cabal-install version 1.20.0.4
using version 1.20.0.2 of the Cabal library

Windows命令提示符

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>cabal update
Downloading the latest package list from hackage.haskell.org
Note: there is a new version of cabal-install available.
To upgrade, run: cabal install cabal-install

C:\Windows\system32>cabal install cabal-install
Resolving dependencies...
Configuring cabal-install-1.22.0.0...
Building cabal-install-1.22.0.0...
Preprocessing executable 'cabal' for cabal-install-1.22.0.0...
[ 1 of 77] Compiling Distribution.Client.Dependency.Modular.Version ( Distributi
on\Client\Dependency\Modular\Version.hs, dist\build\cabal\cabal-tmp\Distribution
\Client\Dependency\Modular\Version.o )
[ 2 of 77] Compiling Distribution.Client.Dependency.Modular.PSQ ( Distribution\C
lient\Dependency\Modular\PSQ.hs, dist\build\cabal\cabal-tmp\Distribution\Client\
Dependency\Modular\PSQ.o )
...
...
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x44d6): undefined reference to `shutdow
nWinSock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x4c8e): undefined reference to `shutdow
nWinSock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x4ceb): undefined reference to `initWin
Sock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/l
ibHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x4e36): undefined reference to `shutdow
nWinSock'
c:/program files/haskell platform/2014.2.0.0/mingw/bin/../lib/gcc/x86_64-w64-min
gw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Alberto\AppData\R
oaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/libHSHTTP-4000.2.19.a(TCP.o
): bad reloc address 0x0 in section `.data'
c:/program files/haskell platform/2014.2.0.0/mingw/bin/../lib/gcc/x86_64-w64-min
gw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: final link failed: Invalid
 operation
collect2: ld returned 1 exit status
Failed to install cabal-install-1.22.0.0
cabal: Error: some packages failed to install:
cabal-install-1.22.0.0 failed during the building phase. The exception was:
ExitFailure 1

来自Cygwin64终端:

Alberto@Alberto-PC ~
$ cabal install cabal-install
Resolving dependencies...
Configuring cabal-install-1.22.0.0...
Building cabal-install-1.22.0.0...
Preprocessing executable 'cabal' for cabal-install-1.22.0.0...
[ 1 of 77] Compiling Distribution.Client.Dependency.Modular.Version ( Distribution\Client\Dependency\Modular\Version.hs, dist\build\cabal\cabal-tmp\Distribution\Client\Dependency\Modular\Version.o )
[ 2 of 77] Compiling Distribution.Client.Dependency.Modular.PSQ ( Distribution\Client\Dependency\Modular\PSQ.hs, dist\build\cabal\cabal-tmp\Distribution\Client\Dependency\Modular\PSQ.o )
[ 3 of 77] Compiling Distribution.Client.Dependency.Modular.Package ( Distribution\Client\Dependency\Modular\Package.hs, dist\build\cabal\cabal-tmp\Distribution\Client\Dependency\Modular\Package.o )
...
...
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/libHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x4ceb): undefined reference to `initWinSock'
C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/libHSHTTP-4000.2.19.a(TCP.o):fake:(.text+0x4e36): undefined reference to `shutdownWinSock'
c:/program files/haskell platform/2014.2.0.0/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Alberto\AppData\Roaming\cabal\x86_64-windows-ghc-7.8.3\HTTP-4000.2.19/libHSHTTP-4000.2.19.a(TCP.o): bad reloc address 0x0 in section `.data'
c:/program files/haskell platform/2014.2.0.0/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: final link failed: Invalid operation
collect2: ld returned 1 exit status
Failed to install cabal-install-1.22.0.0
cabal.exe: Error: some packages failed to install:
cabal-install-1.22.0.0 failed during the building phase. The exception was:
ExitFailure 1

1 个答案:

答案 0 :(得分:0)

对于记录,此问题与在Windows上安装network有关。新版本的Haskell平台以及堆栈都可以解决这个问题。此外,特别是cabal-install的安装,在cabal网站上提供了二进制文件。