This discussion is archived
1 Reply Latest reply: Jan 19, 2013 2:49 PM by EJP RSS

How to load multiple shared libraries

984427 Newbie
Currently Being Moderated
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.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points