Solved: Loading natives manually.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Solved: Loading natives manually.

Firecow
This post was updated on .
Hey you guys..

I've been trying to make my own startup progress bar for my Jogl application..
In that work, i needed to load the Jogl and Gluegen natives manually...
As I've understood this can be done quite easily using System.load() if you want the native from an absolute path.
Just to make it as simple as possible to start of with, I'm trying to fetch the natives from a local location on my machine. Later i'll be caching then, so they won't be reloaded everytime.

My sample code
public static void main(String[] args) {
        System.load("/home/me/libjogl.so");
        System.load("/home/me/libjogl_awt.so");
        System.load("/home/me/libjogl_cg.so");
       
        System.load("/home/me/libgluegen-rt.so");
}

This is the exception i get:
Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/firecow/libjogl_cg.so: libCg.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:1803)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1699)
        at java.lang.Runtime.load0(Runtime.java:770)
        at java.lang.System.load(System.java:1003)
        at bootstrap.NativeLoader.main(NativeLoader.java:381)

Why am I getting this exception?

Perhaps its my lack of understanding what a .so file actually is.
But to me this looks like it have an external reference to another .so file.
If that is the case how does a standard Jogl.jnlp file load theese other shared object files ?

By the way i'm running this in Ubuntu 10.04

Best
  Mads

Reply | Threaded
Open this post in threaded view
|

Re: Loading natives manually.

gouessej
Administrator
Hi!

You simply don't need to load libjogl_cg.so, it is not mandatory as it is used for NVIDIA shaders only.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Loading natives manually.

Firecow
Yeah, you're right...

If you really do want to run the shaders, install the 'nvidia-cg-toolkit' package on Ubuntu...
So it was missing an external reference, but it was in my operating system...