當運行導入幾個包像這樣的Haskell程序:解決GHC「我找到了符號的重複定義...」
import Text.Feed.Import
import Network.HTTP
main = do
page <- simpleHTTP (getRequest "http://stackoverflow.com")
print $ page
我得到一個錯誤,像這樣的(注:這個問題所要解決的一般問題,這種特定的情況只是一個例子):如所描述的in this previous post
GHCi runtime linker: fatal error: I found a duplicate definition for symbol get_current_timezone_seconds
whilst processing object file
/usr/lib/ghc/time-1.4.0.1/HStime-1.4.0.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
重新安裝封裝(例如在上述情況下HTTP
和feed
)沒有幫助。我該如何解決這個問題?
或者您可以使用沙盒構建來確保每個包得到一致的一組代碼。 –
感謝您在SO上記錄此信息。 –
爲了找出哪些軟件包依賴有問題的庫,只需使用'ghc-pkg unregister'而不用'--force'標誌。 –