GHC - 出现奇怪的动态链接器错误(libffi.so.4)
每当我尝试使用 ghc --make 编译可执行文件时,尽管编译时没有错误,但之后尝试执行该程序时,我都会收到以下错误:(
./main: error while loading shared libraries: libffi.so.4: cannot open shared object file: No such file or directory
如果我将程序加载到 ghci 中,则效果很好)
这是一个最小的示例程序曾经可以工作,但现在不行(我不知道为什么)
module Main(main)
where
main = do c <- getContents
putStr c
我在 Ubuntu 11.10 上使用 GHC 7.0.3。如有帮助,将不胜感激。
更新:从包管理器中删除并重新安装也没有修复它。我有 libffi5 和 libffi6,如何让 ghc 使用其中之一而不是 libffi4?
Whenever I try to compile an executable with ghc --make, I am getting the following error when trying to execute the program afterwards, despite there being no errors upon compilation:
./main: error while loading shared libraries: libffi.so.4: cannot open shared object file: No such file or directory
(It works fine if I load the programs into ghci though)
Here's a minimal example program that used to work, but now doesn't (I don't know why)
module Main(main)
where
main = do c <- getContents
putStr c
I am using GHC 7.0.3, on Ubuntu 11.10. Help would be appreciated.
Update: Removing and reinstalling from the package manager didn't fix it either. I do have libffi5 and libffi6, how do I get ghc to use one of these instead of libffi4?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我现在通过复制 libffi.so.5 并将副本重命名为 libffi.so.4 来修复它 - 有点肮脏的黑客,但由于我现在不打算分发二进制文件,我并不介意,只要它作品。尽管我仍然希望有人能够向我展示更好的解决方案。
I got it fixed for now by just copying libffi.so.5 and renaming the copy to libffi.so.4 - kinda dirty hack, but as I am not planning on distributing binaries for now I don't really mind as long as it works. Though I would still prefer if someone was able to show me a better solution.