【问题标题】:Compiled program cannot find a library编译后的程序找不到库
【发布时间】:2014-09-05 13:41:05
【问题描述】:

首先:我完全是新手。
我有一个引发此错误的编译程序:

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,可能该库位于 foreign 搜索路径之外的某个位置。我的图书馆位于/usr/lib/swi-prolog/lib/amd64/pl2xpce.so。所以,我的问题:

  • 如何检查foreign 路径是什么?
  • 如何让我的程序找到这个库?

我在 Ubuntu 13.10 机器上使用 SWI Prolog 的开发版本。
提前致谢。

编辑:我在SWI-Prolog mailing list 上发布了同样的问题,并按照他们的建议,我刚刚切换回 stable 版本。现在似乎一切正常。

【问题讨论】:

    标签: linux prolog swi-prolog


    【解决方案1】:
    1. 库路径一般配置在/etc/ld.so.conf.d/目录下, 在我的机器上,/etc/ld.so.conf 文件包含该目录下的所有 .conf 文件

      ➜ 数据分析 git:(master) cat /etc/ld.so.conf

      包括 /etc/ld.so.conf.d/*.conf

    2. 所以你可以在 /etc/ld.so.conf.d/ 下创建另一个 conf 文件(例如 prolog.conf,其中包含 prolog 库的路径),然后运行 sudo ldconfig命令更新ld路径

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多