Relocation Error In Solaris - Symbol 0FI__rtbi_fv not found

Hi!,

I get the following error, when i try to load a library using JNI, (jdk 1.3.0_02) in Solaris 2.6 :

It cribs about symbol __0FI__rtbi_fv not found.

I used nm on the .so and got the following output -

[123762]| 0|0|NOTY |GLOB |0|UNDEF |__0FI__rtbi_fv

Kindly help me in overcoming this problem. Its bit urgent.

Exception in thread "main" java.lang.UnsatisfiedLinkError: /disk1/anuj/Sinu/usrtool/obj/libusrtool.so:

ld.so.1: /disk1/sriram/java1.3/bin/../bin/sparc/native_threads/java:

fatal: relocation error: file /disk1/anuj/Sinu/usrtool/obj/libusrtool.so:

symbol __0FI__rtbi_fv: 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.Runtime.loadLibrary(Runtime.java:737)

regards

Sriram

[1027 byte] By [sriramj76] at [2007-9-26 11:17:56]
# 1
Are you using C++ templates?You might check the flags that you are using to compile with.
jschell at 2007-7-2 0:21:50 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2
hi jschell,Thks for u effort. I have got it solved. We added -lC to the linking options (libC library)regardsSriram
sriramj76 at 2007-7-2 0:21:50 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3
Hi and thank you very much for solving it.I was wasting time on the problem and saw the same question in the database several times without an answer.Why isn't this clearly mentionned in the java documentation ?Regards,Philippe.
Maleze at 2007-7-2 0:21:50 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 4

It is not in the java documentation because it is not a java problem.

When you write JNI code (or any other code for that matter) you probably should look at the documentation for the compilers and other tools that you are using for recommendations for how to use these third party tools.

What would have been surprizing to me, is if your C++ compiler manual did not recommend linking with the standard C++ library when you use code contained in the library. Which was the problem here.

daney at 2007-7-2 0:21:50 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 5

hello,

I have a similar problem with JMagick program in solaris 8, but i don?t know how i can solve, because options are in Make files. When i change something, doesn?t work.

Error is:

ld.so.1: /usr/j2sdk1.4.0/bin/java: fatal: relocation error: file /apps/ImageMagic/JMagick-5.5.6-0/lib/.libs/libJMagick.so.5.0.560: symbol ParseImageGeometry: referenced symbol not found

Killed

help, please

delfernan at 2007-7-2 0:21:50 > top of Java-index,Java HotSpot Virtual Machine,Specifications...