jogl_cg.dll ! unsatisfied link error - Help needed

hi guys,
I am new to the forum and sorry if this question has been posed before.
I am trying to loadlibrary jogl.dll, jogl_cg.dll using System.LoadLibrary as shown below in my main class

    System.loadLibrary("jogl");
    
    System.loadLibrary("jogl_cg");

its showing an unsatisfied link error for “jogl_cg” as shown below

Exception in thread “main” java.lang.UnsatisfiedLinkError: C:\java\tools\jogl_cg.dll: Can’t find dependent libraries
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 testlib.Main.main(Main.java:35)
Java Result: 1

I think it depends on some other library. I would appreciate if some body can help me in this regard

thanks in advance,

Ravi ananthuni.

Skip the System.loadLibrary alltogether and make sure, the dll’s are either in your working dir (e.g. in the same folder where your start your program), or set your java.library.path to the directory with your jogl-dlls by appending the following to your java call:


-Djava.library.path="C:\java\tools\"

and oh… if you are using Netbeans 5 as IDE, download my project template plugin: http://www.java-gaming.org/forums/index.php?topic=12530.0 :slight_smile:

Thanks cylab, For your immediate reply. I am trying to use jogl with java web start. Hence i need to load libraries. Its working fine without the system.loadlibrary for my system, but i need to deploy the jogl application on the client machine. I downloaded the latest jogl releases. All i need to is access the these libaries on the client machine. I am able to download them to the client machine. I know it can be done as the jogl examples demos work in the same fashion. Do you have a clue how to access jogl.dll, jogl_awt.dll and jogl_cg.dll on the client machine? Forget about th client machine, i am not able to load them on my machine. your help will be appreciated.

thanks,
ravi.

Just download and examine the jnlp-file from the Gears-demo. Nor for webstart a System.loadLibrary is needed:
http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/Gears.jnlp

I did that yesterday and surprisingly did not find a system.loadlibrary being used. I will go through it in detail and find out how they are able to implement the demo in deatail.
Thanks,
ravi.

There is no difference in the .java files. The natives are only referenced in the .jnlp file. There is nothing more to do.

thanks for the reply. I found something strange. I am able to download all the libraries to the client machine. In the client machine all the dll’s are fine within the jar file. these libraries were getting unpacked automatically. How ever the unpacked directory with the same name as the jar file dosent conatin anything(jogl.dll…etc are not found). What am i doing wrong. Is it something to do with the signing of the jar file?

thanks,
ravi.

Don’t know. Probably you can’t have a unsigned natives jar in webstart. Do you have created your own jogl/natives library or are you just referencing the official ones (recommended).

i got the problem solved. I was actually creating a directory with all the dll’s and adding the directory to the jarfile rather than adding the dll’s directly to the jarfile. When i tried adding the dll’s directly to the jar file its working fine. All the jarfiles are getting unpacked as they should be. I will test whether they are being accessed or not and inform you.

thanks,
ravi.

I am getting the following error.While trying to run the application.

java.lang.UnsatisfiedLinkError: no jogl in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.sun.opengl.impl.NativeLibLoader$1.run(NativeLibLoader.java:66)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.opengl.impl.NativeLibLoader.loadCore(NativeLibLoader.java:64)
at com.sun.opengl.impl.windows.WindowsGLDrawableFactory.(WindowsGLDrawableFactory.java:59)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.java:106)
at javax.media.opengl.GLCanvas.(GLCanvas.java:113)
at javax.media.opengl.GLCanvas.(GLCanvas.java:82)
at javax.media.opengl.GLCanvas.(GLCanvas.java:75)
at jex.Main.(Main.java:55)
at jex.Main.main(Main.java:72)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Java Web Start Error:

null

I tried it by removing the jogl.dll,jogl_awt.dll, jogl_cg.dll from the usual classpath(jre/bin) so that it will access the dlls that are downloaded. Its not doing that and searching for the dlls in the java bin. Is there a place in the application where we specify the classpath. Like in the manifest file or .java or jnlp. I am missing something?
thanks,
ravi.

GOt it finally. But this is something strange. When i try to launch the application through the link or url of jnlp in the browser its accessing the dll’s and working fine. However if i launch the jnlp file by clicking it, its searching for the dlls in the default classpath and giving the exception as mentioned above. Anyways thanks a lot for helping. Appreciated.

ravi.