UnsatisfiedLinkError exception thrown on iostream in JNI-C++ program
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alok_Verma
Posted On:   Sunday, December 9, 2001 11:14 PM

Hi All i have a simple java program invoking a method thru JNI to a C++ method. The C++ library includes iostream.h. The JVM run time has library path of /usr/lib where C++ libs are stored. I get the following exception in loadLibrary method call: loading dcparser library.... Exception in thread "main" java.lang.UnsatisfiedLinkError: /vob/multi-dm/src/XParser/libdcparser.so: ld.so.1: /auto/vnm/multidm/3rdparty/j2sdk1_3_1/bin/../bin/sparc/native_threads/java: fatal: relocation error: file /vob/multi-dm/src/XParser/libdcparser.so: symbol __0oNIostream_initdtv: referenced symbol not found at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(   More>>

Hi All


i have a simple java program invoking a method thru JNI to a C++ method. The C++ library includes iostream.h. The JVM run time has library path of /usr/lib where C++ libs are stored. I get the following exception in loadLibrary method call:



loading dcparser library....
Exception in thread "main" java.lang.UnsatisfiedLinkError: /vob/multi-dm/src/XParser/libdcparser.so: ld.so.1: /auto/vnm/multidm/3rdparty/j2sdk1_3_1/bin/../bin/sparc/native_threads/java: fatal: relocation error: file /vob/multi-dm/src/XParser/libdcparser.so: symbol __0oNIostream_initdtv: referenced symbol not found
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1382)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1306)
at java.lang.Runtime.loadLibrary0(Runtime.java:749)
at java.lang.System.loadLibrary(System.java:820)
at DCParser. (DCParser.java:50)




Doing an nm on C++ shared lib i created, shows undefined symbol for iostream as well as printf call. But, if i remove iostream.h include and associated calls, the java prog is able to resolve printf, but when i include iostream.h, i get the above exception

run environment:

jdk1.3.1
solaris 2.7
Sun C++ 4.2

Any help will be greatly appreciated

Alok

   <<Less
About | Sitemap | Contact