[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem loading .so file in java

From: Nicola Pero
Subject: Re: problem loading .so file in java
Date: Mon, 29 Oct 2001 13:57:10 +0000 (GMT)

> The folowing error is generated while loading 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
> /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/
> 0: symbol __objc_class_name_NXConstantString: referenced symbol not found
>         at java.lang.ClassLoader$NativeLibrary.load(Native Method)
>         at java.lang.ClassLoader.loadLibrary0(
>         at java.lang.ClassLoader.loadLibrary(
>         at java.lang.Runtime.loadLibrary0(
>         at java.lang.System.loadLibrary(
>         at Testso.main( 

 1. you need to use a shared libobjc (it must be called 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 - is linked against and
    and all libraries required by, so when JIGS loads, 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 ...

reply via email to

[Prev in Thread] Current Thread [Next in Thread]