Jump to content
Aerosol

GHCi runtime linker found a duplicate definition error

Recommended Posts

Posted

Today I started to play with attoparsec package and tried to write simple parser. I wrote really toy data type like this:

module SimpleParser where

import qualified Data.ByteString.Char8 as BS
import Data.Attoparsec.ByteString

data Str = End deriving (Show, Eq)

I tried to type:

  • *SimpleParser> End

in ghci and will get End as I expected. Instead End I got following error:

GHCi runtime linker: fatal error: I found a duplicate definition for symbol
_hs_bytestring_long_long_uint_hex
whilst processing object file
/home/alex/.cabal/lib/x86_64-linux-ghc-7.6.3/bytestring-0.10.4.0/HSbytestring-0.10.4.0.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.

As we can see in error output GHCi runtime linker found duplicate definition of _hs_bytestring_long_long_uint_hex. Let's see what's wrong bytestring package with:

cabal info bytestring

It will give us output like this:

* bytestring       (library)
Synopsis: Fast, compact, strict and lazy byte strings with a list
interface
Versions available: 0.9.0.4, 0.9.1.9, 0.9.1.10, 0.9.2.0, 0.9.2.1, 0.10.0.1,
0.10.0.2, 0.10.2.0, 0.10.4.0 (and 14 others)
Versions installed: 0.10.4.0, 0.10.2.0
Homepage: https://github.com/haskell/bytestring
Bug reports: https://github.com/haskell/bytestring/issues
Description: An efficient compact, immutable byte string type (both strict
and lazy) suitable for binary or 8-bit character data.
..............................................
..............................................
..............................................

We can note that there two installed versions of bytestring package. Let's remove old version with:

  • sudo ghc-pkg unregister --force bytestring-0.10.0.2

That's all. After this error with GHCi runtime linker found a duplicate definition error...... will disappear.

Source

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...