GHC - 出现奇怪的动态链接器错误(libffi.so.4)

发布于 2024-12-21 14:07:58 字数 514 浏览 3 评论 0原文

每当我尝试使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

会发光的星星闪亮亮i 2024-12-28 14:07:58

我现在通过复制 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文