【问题标题】:cabal reports "/usr/bin/ld: cannot find -lHSrandom-1.0.1.1-ghc7.8.3"阴谋集团报告“/usr/bin/ld: 找不到 -lHSrandom-1.0.1.1-ghc7.8.3”
【发布时间】:2014-09-10 09:37:19
【问题描述】:

我有 Ubuntu 14.04LTS。我从http://www.haskell.org/ghc/download_ghc_7_8_3#x86_64linux下载了最新的ghc-7.8.3并安装到/usr/local

然后我将我的cabal 更新为版本1.20.0.3

我在终端输入cabal install QuickCheck,得到:

Resolving dependencies...
Configuring tf-random-0.5...
Building tf-random-0.5...
Preprocessing library tf-random-0.5...
[1 of 4] Compiling System.Random.TF.Gen ( src/System/Random/TF/Gen.hs, dist/build/System/Random/TF/Gen.o )
[2 of 4] Compiling System.Random.TF.Init ( src/System/Random/TF/Init.hs, dist/build/System/Random/TF/Init.o )

src/System/Random/TF/Init.hs:94:5: Warning:
    In the use of ‘bitSize’ (imported from Data.Bits):
    Deprecated: "Use 'bitSizeMaybe' or 'finiteBitSize' instead"
[3 of 4] Compiling System.Random.TF.Instances ( src/System/Random/TF/Instances.hs, dist/build/System/Random/TF/Instances.o )
[4 of 4] Compiling System.Random.TF ( src/System/Random/TF.hs, dist/build/System/Random/TF.o )
/usr/bin/ld: cannot find -lHSrandom-1.0.1.1-ghc7.8.3
collect2: error: ld returned 1 exit status
Failed to install tf-random-0.5
cabal: Error: some packages failed to install:
QuickCheck-2.7.5 depends on tf-random-0.5 which failed to install.
tf-random-0.5 failed during the building phase. The exception was:
ExitFailure 1

顺便说一句,我之前已经通过apt-get 安装了haskell-platformghc-7.6.3

【问题讨论】:

    标签: haskell ld cabal


    【解决方案1】:

    我记得在设置 ghc-7.8 时遇到过类似的问题。它与新的 cabal 有关,它在某种程度上与使用旧版本安装的库不兼容(但它未能给出正确的问题原因。

    无论如何,我认为重新安装有问题的软件包

    cabal install random --reinstall --force-reinstalls 
    

    设置它,这样cabal install tf-random 应该会成功。

    【讨论】:

    • 与 cabal 一样,kludgest 解决方案是最好的办法。
    • 这也可以修复其他库的类似错误。如果你看到/usr/bin/ld: cannot find -lHSfoobar-1.0.1.1-ghc7.8.3,那么你需要cabal install foobar -reinstall --force-reinstalls。您可能需要指定特定版本。
    • 我在gmp 库中遇到了类似的错误,请参阅我的question,但不幸的是,上述修复不起作用。还有其他建议吗?
    猜你喜欢
    • 1970-01-01
    • 2021-05-07
    • 2011-07-16
    • 1970-01-01
    • 2012-05-17
    • 2020-04-14
    • 2012-03-26
    • 2018-12-13
    • 2015-09-22
    相关资源
    最近更新 更多