Question about packages and GHCi

Simon Marlow simonmar at microsoft.com
Wed Feb 2 04:26:54 EST 2005


On 02 February 2005 01:52, Martin Erwig wrote:

> I apologize if this is the wrong mailing list to turn to,
> but I would be grateful for any help with two problems
> I have when trying to add a package to GHCi. (I wasn't able
> to find sufficient information in the documentation for packages
>
http://www.haskell.org/ghc/docs/latest/html/users_guide/packages.html.)
> 
> 
> (1) When I try to add a package to ghc, I receive the
> error message that a GHCi lib fil cannot be found.
> 
>    > ghc-pkg -u -i fgl.pkg
>    Reading package info from "fgl.pkg"done.
>    Expanding embedded variables... done.
>    warning: can't find GHCi lib `HSfgl.o'
>    Saving old package config file... done.
>    Writing new package config file... done.
> 
> The missing file `HSfgl.o' is located on the
> current directory as well as in the directory
> where all other .o and .a files for GHC are
> kept (/usr/local/lib/ghc-6.2/).

ghc-pkg is looking in the directories specified in the library_dirs
field in fgl.pkg.  HSfgl.o should be in one of those directories.

> (2) Maybe related to the previous problem is the
> following. When I start "ghci -package fgl", I receive
> the following error message:
> 
>    Loading package base ... linking ... done.
>    Loading package haskell98 ... linking ... done.
>    Loading package haskell-src ... linking ... done.
>    Loading package fgl ...
> 
>    GHCi runtime linker: fatal error: I found a duplicate definition
> for symbol
>       __module_registered
>    whilst processing object file
>       /usr/local/lib/ghc-6.2/HSfgl.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. 

I vaguely remembered seeing this before...  googling for 'duplicate
__module_registered' turned up this:

http://www.haskell.org/pipermail/glasgow-haskell-users/2003-December/006
042.html

which indicates that perhaps you should add -x to ld when building
HSfgl.o?

What version of GHC is this, BTW?
 
Cheers,
	Simon


More information about the Libraries mailing list