问题描述
我在ghc7.0.2.上创建了yesod应用程序.
I created a yesod application on ghc7.0.2.
当我使用命令runhaskell devel-server.hs
来运行应用程序时,发生了错误:
when i use the command runhaskell devel-server.hs
to run the app, errors occurred:
GHCi runtime linker: fatal error: I found a duplicate definition for symbol
ghczm7zi0zi2_AsmCodeGen_zdfMonadCmmOptM2_closure
whilst processing object file
/usr/local/lib/ghc-7.0.2/ghc-7.0.2/libHSghc-7.0.2.a
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.
谁可以帮助我?谢谢!
推荐答案
我似乎在cabal
上遇到了很多麻烦,而且我倾向于安装随机软件包.每当遇到这种情况时,我都会执行以下操作(关于 GHC软件包管理也很有帮助):
I seem to run into this probably quite a lot with cabal
and my tendency to install random packages. Whenever I've had a situation like this, I've done the following (the section on GHC package management is also helpful):
ghc-pkg check
将报告任何问题.完成此操作后,我便会执行ghc-pkg unregister <offending_package>
并希望问题消除.
Which will report any problems. Once I've done this I do ghc-pkg unregister <offending_package>
and hope that the problem goes away.
如果失败,则执行ghc-pkg list
列出软件包并开始卸载(通过ghc-pkg unregister X
)不再需要的软件包或具有多个旧版本的软件包(由于我经常更新到最新版本而导致) ).
If this fails I then do ghc-pkg list
to list the packages and start uninstalling (via ghc-pkg unregister X
) packages that I no longer need or that I have multiple old versions of (caused by me frequently updating to the bleeding edge builds).
这个过程似乎总是使我陷入困境,但这并不是特别科学,因此希望有人有更好的主意!
This process always seems to dig me out of holes like this, but it isn't particularly scientific so hopefully someone has a better idea!
这篇关于ghc7.02上的runhaskell错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!