Reputation: 729
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:
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.
Upvotes: 3
Views: 3371
Reputation: 729
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.
Upvotes: 1
Reputation: 68887
You have to config the LD_LIBRARY_PATH
, I think. Try to add the location of the so-library file. And make sure, your System.loadLibrary();
call is relative.
Upvotes: 1