gcj: issue with run time library loading

Vaijayanthi Mala Suresh <[email protected]>
Newsgroups gmane.comp.gcc.java.devel
Message-ID <[email protected]>
Hi,

I am trying to use JNI calls using gcj.

Hello.java is the jave code having a native method.

gcj -c -fjni Hello.java -o MyApp.o
gcjh Hello -o MyApp.h
ar -rcs libHello.a MyApp.o

Hello.c contains the native code implementation
gcjh -jni Hello
g++ -c Hello.c
ar rcs libNative.a Hello.o


I have a test.cpp where I have initialized the JVM and I am trying to
invoke a method in the Java code which inturn invokes the native
method. I have linked the above libraries along with test.o

I am getting the following error

Unhandled Java exception:
java.lang.UnsatisfiedLinkError: natPrint
   <<No stacktrace available>>

Can anyone help me to resolve this problem.

Thanks
Mala
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.