• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

unsatisfiedlinkerror while loading library file

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is what I am trying to do.
I have a c file, which we are trying to use in java through JNI

Compiling getDBMImpl.c file with
gcc -fPIC -c getDBMImpl.c

creating library file
gcc -shared -o libmylib.so getDBMImpl.o

setting environment variable LD_LIBRARY_PATH to the directory where library file is located.

We are trying to load this library in WebHost.java with underline code.
System.loadLibrary("mylib");

This is working fine on my system but gives the following error on other system.
Exception in thread "main" java.lang.UnsatisfiedLinkError: no mylib in java.library.path
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.<init>(Throwable.java:87)
at java.lang.Error.<init>(Error.java:43)
at java.lang.LinkageError.<init>(LinkageError.java:36)
at java.lang.UnsatisfiedLinkError.<init>(UnsatisfiedLinkError.java:35)
at java.lang.ClassLoader.loadLibrary(Compiled Code)
at java.lang.Runtime.loadLibrary0(Runtime.java:467)
at java.lang.System.loadLibrary(System.java:771)
at <Unloaded Method>



I also tried following two options but no use.

1 Setting java.library.path
2 System.load("/home/gaurs2/trunk"); (giving absolute path of the shared object)

I am compiling and making library files on my system and copying them on the other as there is no compiler on that system.
IS THERE ANY PROBLEM IN THIS.


Thanks in advance
siddharth
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic