考虑下面的简单代码:
import Crypto.Hash.SHA1 (hashlazy)
import qualified Data.ByteString as BS
main = return ()
我安装了cabal install --global bytestring
然后我获得(在使用 ghc 7.4.1 新安装的 Ubuntu 12.04 机器上):
GHCi runtime linker: fatal error: I found a duplicate definition for symbol
fps_minimum
whilst processing object file
/usr/local/lib/bytestring-0.10.0.1/ghc-7.4.1/HSbytestring-0.10.0.1.o
This could be caused by:
* Loading two different object files which export the same symbol
* Specifying the same object file twice on the GHCi command line
* An incorrect `package.conf' entry, causing some object to be
loaded twice.
GHCi cannot safely continue in this situation. Exiting now. Sorry.
我能用它做什么呢?
这是钻石依赖性问题。您有一个针对一个版本的字节串构建的 cryptohash 版本,但 GHC 系统的其余部分是针对另一个版本构建的。因此,当包链接在一起时,链接了两个略有不同版本的字节串。
通常这是可以的,只要字节串类型兼容即可。
然而,bytestring 包含一个用于某些实用程序的小型 C 库。 C 库具有非唯一符号,可以防止重复链接,因此会出现错误。
您需要确保 cryptohash 是针对相同版本的字节串构建的。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)