首先:我是一个新手。
我有一个引发此错误的编译程序:
ERROR: pl2xpce: cannot open shared object file: No such file or directory
ERROR: Failed to initialise the XPCE tookit. This is normally
ERROR: caused by a missing or incompatible X11 library.
ERROR: See http://www.swi-prolog.org/build/issues/xpce.html
ERROR: Sorry, cannot recover from this. Process terminates.
我已阅读 here也许图书馆被放置在外国搜索路径之外的某个地方。我的库放在 /usr/lib/swi-prolog/lib/amd64/pl2xpce.so
中。所以,我的问题:
- 如何检查哪个是外部路径?
- 如何让我的程序找到这个库?
我在 Ubuntu 13.10 机器上使用 SWI Prolog 的开发版本。
提前致谢。
编辑:我在 SWI-Prolog mailing list 上发布了完全相同的问题并按照他们的建议,我刚刚切换回 稳定 版本。现在一切似乎都正常了。
最佳答案
库路径一般配置在/etc/ld.so.conf.d/目录下, 在我的机器上,/etc/ld.so.conf 文件包含该目录下的所有 .conf 文件
➜ 数据分析 git:(master) cat/etc/ld.so.conf
包括/etc/ld.so.conf.d/*.conf
所以你可以在/etc/ld.so.conf.d/下创建另一个 conf 文件(例如 prolog.conf 其中包含 prolog 库的路径)然后运行
sudo ldconfig
命令更新ld路径
关于linux - 编译的程序找不到库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25687294/