Here’s the error ghci throws when I try to run my program.
>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.
Here’s the source, followed by what I think this problem is.
>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))
I have two versions of primitive.0.3.1 and 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 has revealed I have a whole mess of broken packages. Perhaps I should delete ghc and cabal and start from scratch?
The problem stems from an incorrect solution to this problem
Here is the actual problem causing this trouble, with reference to the solution.