haskell – 有人可以提供解决可能的包冲突的故障排除步骤吗?

这是我尝试运行程序时出现的错误ghci.

>Loading package primitive-0.3.1 ...

>GHCi runtime linker: fatal error: I found a duplicate definition for symbol
>memset_off
>whilst processing object file
>/home/mlitchard/.cabal/lib/primitive-0.3.1/ghc-7.0.3/HSprimitive-0.3.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.

这是源头,接下来是我认为这个问题.

>import Network.HTTP.Enumerator
>import qualified Data.ByteString.Lazy as L
>import Data.ByteString
>import Data.Attoparsec.Enumerator (iterParser)
>import Data.Aeson
>import Data.Attoparsec
>import Data.Maybe
>import Network.URI
>import Network.HTTP

>main :: IO ()
>main = do
>req <- openURL "https://pkg.cudaops.com/cgi-bin/qaLinkEditor.cgi?json=1"
>print $parse json req

>openURL :: String -> IO ByteString
>openURL url = getResponseBody =<< simpleHTTP (mkRequest GET (fromJust $parseURI url))

我有两个版本的primitive.0.3.1和0.4.0.1

>0.3.1 is needed by aeson 0.3.2.12
>0.4.0.1 is needed by http-enumerator-0.7.1.1

ghc-pkg透露我有一堆破碎的包裹.也许我应该删除ghc和cabal并从头开始?

最佳答案 问题源于对此
problem的错误解决方案

Here是引起这个问题的实际问题,参考解决方案.

点赞