[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problem loading .so file in java
From: |
kotesh |
Subject: |
Re: problem loading .so file in java |
Date: |
Mon, 29 Oct 2001 20:46:20 +0530 |
Thank you very much..
We will follow your suggestion .
Thanks
kotesh
----- Original Message -----
From: "Nicola Pero" <nicola@brainstorm.co.uk>
To: "kotesh" <kotesh@orillion.com>
Cc: <help-gnustep@gnu.org>
Sent: Monday, October 29, 2001 7:27 PM
Subject: Re: problem loading .so file in java
>
> > The folowing error is generated while loading Security.so file from java
> > using System.loadLibrary("Security").
> >
> > Exception in thread "main" java.lang.UnsatisfiedLinkError:
/usr/GNUstep/System/L
> >
ibrary/Frameworks/Security.framework/Versions/A/sparc/solaris2.8/gnu-gnu-gnu
/lib
> > Security.so.1.0.0: ld.so.1:
/LocalLibrary/NMS/java/jre/bin/../bin/sparc/native_t
> > hreads/java: fatal: relocation error: file
/usr/GNUstep/System/Library/Framework
> >
s/Security.framework/Versions/A/sparc/solaris2.8/gnu-gnu-gnu/libSecurity.so.
1.0.
> > 0: symbol __objc_class_name_NXConstantString: 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 Testso.main(Testso.java:6)
>
> 1. you need to use a shared libobjc (it must be called libobjc.so and not
> libobjc.a); compile and install gnustep-objc if you don't have it.
>
> 2. when you load a library, all symbols in the library must be resolved.
> to get this, you might need to load other libraries before (to resolve
> symbols which might otherwise be unresolved) ... which means you need
> to load explicitly all library required in the correct order ... or
> you can link the library itself against the required libraries, so
> that when you load the library, all the required libraries are
> automatically loaded ... if you use JIGS, this is how all works -
> libgnustep-java.so is linked against libobjc.so and libgnustep-base.so
> and all libraries required by libgnustep-base.so, so when JIGS loads
> libgnustep-java.so, it automatically drags in all libraries needed
> for gnustep-base based Objective-C sruff, and after that you can load
> any library using gnustep-base/Objective-C (even if not linked
> explicitly against libgnustep-base/libobjc) without need to do
> anything special ...
>
> if you need to use an Objective-C library from Java, my suggestion is to
> use JIGS - simply because all the work has already been done, and it works
> out of the box ...