我刚刚在我的笔记本电脑上安装了Mint17,然后使用了haskell平台通用版。(我选择了generic而不是使用apt-get,因为这是我可以获得GHC7.10的唯一方法)
cabal install cabal-install我得到了这个错误:
Resolving dependencies...
Configuring cabal-install-1.22.6.0...
Failed to install cabal-install-1.22.6.0
Build log ( /home/william/.cabal/logs/cabal-install-1.22.6.0.log ):
cabal: Error: some packages failed to install:
cabal-install-1.22.6.0 failed during the configure step. The exception was:
user error ('/usr/local/bin/ghc' exited with an error:
/usr/bin/ld: cannot find -lgmp
collect2: error: ld returned 1 exit status
)有人知道怎么解决这个问题吗?
更新:
已通过安装libgmp-dev修复
发布于 2015-09-08 22:32:28
编辑你已经找到的
sudo apt-get install libgmp-dev应该解决您的问题(对于Mint -对于没有apt-get的系统,您需要使用常驻包管理器,而在其他基于apt-get的系统中,包名称可能会有所不同)。
如果您将来遇到类似的错误,以下是解决问题的理由:ld是一个链接器,本质上是将库链接到正在编译的程序中。gmp是提供给ld的参数,告诉它链接到库gmp中。它找不到这个库,因此您需要:
(a)告诉它它的位置,以防你知道你有这个库(在这种情况下,cabal参数--extra-lib-dirs=很有用),或者
(b)安装库(google库名称和您的系统)。
GMP是GNU MP Bignum库,它在提供Integer和Fractional类型方面发挥了作用。
https://stackoverflow.com/questions/32458924
复制相似问题