greetings,

I need a little assistance with building a shared library for JNI under
Linux 2.2.
This is how I went about creating the library:

compiling: g++ -I /usr/local/java/include
-I/usr/local/java/include/linux -shared -fPIC -o keys.o keys.c

linking: gcc -shared -Wl,-soname,libkeys.so -o libkeys.so.0 keys.o -lc

$ java -Djava.library.path=/home/ams/work/keys T
Exception in thread "main" java.lang.UnsatisfiedLinkError: 
/home/ams/work/keys/libkeys.so: keys.o: 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:1357)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1281)
        at java.lang.Runtime.loadLibrary0(Runtime.java:469)
        at java.lang.System.loadLibrary(System.java:774)
        at T.<clinit>(T.java:5)

I have also tried another way of building the library (ld -G -f
/lib/libuuid.so.1 keys.o -o libkeys.so) but got the same error. I have
to mention that the native code accesses the libdb.so library which i
copied to /home/ams/work/keys. Why doesn't java find my library? TIA,

-a

--
Aaron Stromas    | "Tick-tick-tick!!!... ja, Pantani is weg..."
Oracle Corp      |                             BRTN commentator
+1 703.708.68.21 |                              L'Alpe d'Huez
                                            1995 Tour de France




----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to