LWJGL in Linux

Started by CaseyB, November 15, 2005, 04:20:57

Previous topic - Next topic

CaseyB

I am new to Linux and I am having trouble getting a lwjgl app to run.  I get an unsatisfied link error.  Here is the error:
(cborders)>Run.sh
Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/lib/liblwjgl.so: /usr/lib/liblwjgl.so: cannot open shared object file: No such file or directory
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
        at java.lang.Runtime.loadLibrary0(Runtime.java:822)
        at java.lang.System.loadLibrary(System.java:992)
        at org.lwjgl.Sys$1.run(Sys.java:67)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.lwjgl.Sys.<clinit>(Sys.java:65)
        at org.lwjgl.opengl.Pbuffer.<clinit>(Pbuffer.java:158)
        at elderGods.Game.init(Game.java:63)
        at elderGods.Game.<init>(Game.java:55)
        at elderGods.ElderGods.<init>(ElderGods.java:17)
        at elderGods.ElderGods.main(ElderGods.java:11)

here is the script that I am using to run:
#!/bin/bash
java -Djava.library.path=/usr/lib/ -cp .:ElderGods.jar:lwjgl.jar:lwjgl_util.jar:lwjgl_devil.jar elderGods.ElderGods

and here is proof that the libs are where I think they are:
(cborders)>whereis liblwjgl.so
liblwjgl: /usr/lib/liblwjgl.so


What am I doing wrong here?

Matzon

first of all you really shouldn't install lwjgl into the system path - lwjgl is designed to be run from a local dir.

That said, are the rights on the file correct? - specifically the x bit has to be set for the relevant user/group

CaseyB

I put the libs in the system path when it didn't work from the project directory!  Ok, so I moved them back to the project directory and checked the permissions on the libraries
(cborders)>ls -l *.so
-rwxr-xr-x  1 cborders cborders 728425 Aug 18 15:56 libIL.so
-rwxr-xr-x  1 cborders cborders 171001 Aug 18 15:56 libILU.so
-rwxr-xr-x  1 cborders cborders  42227 Aug 18 15:56 libILUT.so
-rwxr-xr-x  1 cborders cborders  37476 Aug 18 15:56 liblwjgl-devil.so
-rwxr-xr-x  1 cborders cborders 214836 Aug 18 15:56 liblwjgl.so

and modified the script to be:
#!/bin/bash
java -Djava.library.path=./ -cp .:ElderGods.jar:lwjgl.jar:lwjgl_util.jar:lwjgl_devil.jar elderGods.ElderGods

and then
#!/bin/bash
java -Djava.library.path=/home/cborders/Desktop/ElderGods -cp .:ElderGods.jar:lwjgl.jar:lwjgl_util.jar:lwjgl_devil.jar elderGods.ElderGods

and both times I get:
(cborders)>Run.sh
Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/cborders/Desktop/ElderGods/liblwjgl.so: /home/cborders/Desktop/ElderGods/liblwjgl.so: cannot open shared object file: No such file or directory
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
        at java.lang.Runtime.loadLibrary0(Runtime.java:822)
        at java.lang.System.loadLibrary(System.java:992)
        at org.lwjgl.Sys$1.run(Sys.java:67)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.lwjgl.Sys.<clinit>(Sys.java:65)
        at org.lwjgl.opengl.Pbuffer.<clinit>(Pbuffer.java:158)
        at elderGods.Game.init(Game.java:63)
        at elderGods.Game.<init>(Game.java:55)
        at elderGods.ElderGods.<init>(ElderGods.java:17)
        at elderGods.ElderGods.main(ElderGods.java:11)
 :?