我正在使用带有GHC 7.6.3的Ubuntu 14.10和通过Ubuntu软件包安装程序安装的cabal,并尝试使用Heap数据结构,我使用以下方法天真地安装了该数据结构:
cabal install heap
一旦开始将库导入到代码中,就会出现以下链接错误:
...
Loading package primitive-0.5.0.1 ... linking ... done.
...
Loading package heap-1.0.0 ... linking ... done.
...
Loading package primitive-0.5.2.1 ... linking ... done
...
GHCi runtime linker: fatal error: I found a duplicate definition for symbol
hsprimitive_memset_Word32
whilst processing object file
/home/simon/.cabal/lib/primitive-0.5.2.1/ghc-7.6.3/HSprimitive-0.5.2.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.
这个答案从概念上解释了该怎么做,但是说明不够具体,我无法遵循。
我如何让Heap使用Primitive-0.5.2.1(我假设这个轻度使用的库是已过期的库),还是应该做一些完全不同的事情?
一种解决方案可能是专门安装以下版本的早期版本heap
:
cabal install heap-0.6.0
您可能必须首先取消注册heap-1.0.0。
另一个选择是删除〜/ .ghc目录。当然,您将必须重新安装cabal软件包。
我认为最好的选择是开始为您的项目使用阴谋沙箱。
编辑:heap-1.0.0包含QuickCheck测试,因此引入了所有QuickCheck依赖项。要在没有QuickCheck的情况下安装该版本,请尝试以下操作:
cabal get heap-1.0.0
cd heap-1.0.0
heap.cabal
并删除该Build-Depends:
行cabal install
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句