GHCi运行时链接程序:致命错误

时间:2015-10-08 14:21:08

标签: haskell directory gtk ghci

我已经安装了gtk。这两个模块 System.Console.Readline和Graphics.UI.Gtk通常单独工作。但是当我在相同的代码中导入两个模块时,当ghci加载所有包时,显示我:

Loading package array-0.4.0.0 ... linking ... done.
Loading package deepseq-1.3.0.0 ... linking ... done.
Loading package containers-0.4.2.1 ... linking ... done.
Loading package bytestring-0.9.2.1 ... linking ... done.
Loading package transformers-0.4.3.0 ... linking ... done.
Loading package mtl-2.2.1 ... linking ... done.
Loading package text-1.2.0.4 ... linking ... done.
Loading package utf8-string-1.0.1.1 ... linking ... done.
Loading package cairo-0.13.1.0 ... linking ... done.
Loading package glib-0.13.2.1 ... linking ... done.
Loading package gio-0.13.1.0 ... linking ... done.
Loading package filepath-1.3.0.0 ... linking ... done.
Loading package old-locale-1.0.0.4 ... linking ... done.
Loading package time-1.4 ... linking ... done.
Loading package unix-2.5.1.0 ... linking ... done.
Loading package directory-1.2.4.0 ... linking ... done.
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package process-1.2.3.0 ... linking ... done.
Loading package pango-0.13.1.0 ... linking ... done.
Loading package gtk-0.13.9 ... linking ... done.
Loading package old-time-1.1.0.0 ... linking ... done.
Loading package directory-1.1.0.2 ... 

GHCi runtime linker: fatal error: I found a duplicate definition for symbol
   __hscore_S_IXUSR
whilst processing object file
   /usr/lib/ghc/directory-1.1.0.2/HSdirectory-1.1.0.2.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.

我感谢任何帮助!

1 个答案:

答案 0 :(得分:1)

阐述Yuras'回答,要么取消注册未使用的包,要么隐藏它。 要取消注册,请使用(例如)

ghc-pkg unregister directory-1.1.0.2

您也可以在启动ghci时隐藏包。例如:

ghci -hide-package directory-1.1.0.2