linking to jni code

abhishek desai abhi00@gmail.com
Mon May 4 06:47:00 GMT 2009


Hi,
I am using the below command to compile a java program making calls to
native functions implemented using JNI.
gcj --main=MyApp -fjni MyApp.class MyApp.o -o MyApp
Here MyApp.class is the class file generated from MyApp.java
MyApp.o is the object file generated from MyApp.c implementing the JNI
calls InitBase and PrintString.
The command generated the executable but when executing it gives the
following error.
Exception in thread "main" java.lang.UnsatisfiedLinkError: InitBase
 at MyApp.InitBase(MyApp)
 at MyApp.main(MyApp)
Looks like the MyApp.o file does not get linked into the application.
Is there a way to get it linked into the Application statically?


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /