如何解决“符号查找错误”在 Ubuntu11.04 上使用 JPL?
我正在用 Java 编写一个程序,我想连接到 Prolog。因此,我决定使用 JPL。在 Windows Vista 上使用 JPL 是完美的。后来,我不得不将操作系统平台更改为Ubuntu 11.04。不幸的是,有一个错误:
符号查找错误:/usr/lib/swi-prolog/lib/i386/libjpl.so:未定义符号:PL_is_initialized
环境:
- Ubuntu 11.04
- Java 版本 1.6.0_24
- Eclipse Galileo 版本:3.5.2
- SWI- i386 Jpl 的 Prolog 版本 5.10.1
- (apt-get install swi-prolog-java)
- Family.java + family.pl
我解释工作步骤和问题如下。 步骤1:使用Synaptic Package Manager安装swi-prolog + jpl
步骤2:运行Family.java,发现错误
步骤 3:在 VMarguments 配置库路径 step4:再次运行,出现错误 /usr/lib/jvm/java-6-sun-1.6.0.24/bin/java:符号查找错误:/usr/lib/swi-prolog/lib/i386/libjpl.so:未定义符号:PL_is_initialized< /强> step5:我也配置了环境,但是错误还是一样。
我从互联网上搜索到的步骤3和5中用于解决问题的方法。我找不到其他解决方案来尝试。有人有什么想法吗?
提前致谢。
I'm coding a program in Java and I would like to connect to Prolog. Thus, I decided to use JPL. It is perfectly to use JPL on Windows Vista. Later, I have to change the OS platform to be Ubuntu 11.04. Unfortunately, there is an error:
symbol lookup error: /usr/lib/swi-prolog/lib/i386/libjpl.so: undefined symbol: PL_is_initialised
Environment:
- Ubuntu 11.04
- Java version 1.6.0_24
- Eclipse Galileo Version: 3.5.2
- SWI-Prolog version 5.10.1 for i386
- Jpl (apt-get install swi-prolog-java)
- Family.java + family.pl
I explain steps of working and problems as follows.
step1: Install swi-prolog + jpl using Synaptic Package Manager
step2: Run Family.java , found an error
step3: Configure the library path at VMarguments
step4: Run again, there is an error
/usr/lib/jvm/java-6-sun-1.6.0.24/bin/java: symbol lookup error: /usr/lib/swi-prolog/lib/i386/libjpl.so: undefined symbol: PL_is_initialised
step5: I also config the environment but the error still the same.
The method that I used to solve the problem as in step 3 and 5 I searched from the internet. I can not find other solutions to try. Does anyone have any idea?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您必须配置
LD_LIBRARY_PATH
。尝试添加so库文件的位置。并确保您的System.loadLibrary();
调用是相对的。You have to config the
LD_LIBRARY_PATH
, I think. Try to add the location of the so-library file. And make sure, yourSystem.loadLibrary();
call is relative.非常感谢大家的每一份支持。现在,我可以解决这个问题。我从页面 http://code.google.com/p/javanaproche/wiki/HowToJPL 找到了建议
按照说明,我将 swi-prolog 版本更改为构建表单源 pl-5.10 .1.最后,它起作用了。我认为问题的发生是因为从突触管理器获取的 swi-prolog 未设置为共享库。如果有人知道如何设置共享库,那么它可能会起作用。
Thank you very much for every supports. Now,i can manage this problem. I found a suggestion from page http://code.google.com/p/javanaproche/wiki/HowToJPL
Following the instructions, i change the swi-prolog version to be a building form source pl-5.10.1. Finally, it works. I think the problem happens because the swi-prolog getting from synaptic manager doesn't set to be a shared library. If anyone knows how to set a share library , it might be work.