Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CC and libraries

0 views
Skip to first unread message

voie...@lmtas.lmco.com

unread,
May 2, 1997, 3:00:00 AM5/2/97
to

I have the need to intergrate native code into my Java program. I have
been following the tutorial at
http://java.sun.com/nav/read/Tutorial/native1.1/index.html on how to do
this. Anyhow it doesn't quite seem to work when it comes to cc or
executing the Java code. What I am wondering is to do this. I guess the
root of my question is this

I have a a file called 'HelloWorldImp.c' that I want to put into a new
library. It seems to work but then Java complains about not being able to
find it as in the following


heracles 108% cc -c -I/usr/java/include -I/usr/java/include/irix
HelloWorldImp.c -o libhello.so
heracles 109% java Main
1784:/usr/java/bin/../bin/sgi/green_threads/java: rld: Fatal Error:
cannot successfully map soname 'libhello.so' under any of the filenames
/usr/people/mv135329/java/jack/libhello.so:/usr/java/bin/../lib/sgi/green_threads/libhello.so:/usr/lib/libhello.so:/lib/libhello.so:/lib/cmplrs/cc/libhello.so:/usr/lib/cmplrs/cc/libhello.so:
(libhello.so)
java.lang.UnsatisfiedLinkError: no hello in shared library path
at java.lang.Runtime.loadLibrary(Runtime.java:440)
at java.lang.System.loadLibrary(System.java:569)
at
at Main.main(Main.java:3)

The tutorial said if I get the above the my environemnt is set wrong but
I changed the environment to what follows and it can't find libhello.so in
the current directory.


heracles 115% echo $LD_LIBRARY_PATH
/usr/people/mv135329/java/jack
heracles 116% pwd
/usr/people/mv135329/java/jack
heracles 117% ls -l libhello.so
-rw-r--r-- 1 mv135329 caretaker 1652 May 2 09:27 libhello.so

I am currently using JDK 1.1.1 beta on an SGI Indigo 2 with Irix 6.2

Please CC to voie...@lmtas.lmco.com

Thanks

-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet

0 new messages