Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to load multiple shared libraries

984427Jan 19 2013 — edited Jan 19 2013
Hi,

I have 2 shared libraies, libshared1.so and libshared2.so. The libshared2.so depends on libshared1.so. I built the libshared2.so using the command below.

g++ -shared -L./path/to/lib -lshared1 -o ./path/to/lib2/libshared2.so ./myWorkCpp.o


I got following errors when I ran my Java class.

--------------------------
Native code library failed to load.
java.lang.UnsatisfiedLinkError: /path/to/libshared2.so: libshared1.so: cannot open shared object file: No such file or directory
--------------------------


Can anyone please help?


Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 16 2013
Added on Jan 19 2013
1 comment
1,925 views