Help with building shared libraries with dependencies on other shared libraries

Help with building shared libraries with dependencies on other shared libraries

Post by Johnny Shi » Mon, 12 Nov 2001 10:27:39



Hi all,

I'm having problems running my application in Linux (RedHat 7.1) that loads
up ten shared libraries, all but one have dependencies with the other shared
libraries. The application is written in Java, so in the code I load up the
libraries using

System.loadLibrary("lib1");

The libraries are written in C++ and I'm using VIDE (integrated development
environment) to create my makefile. The complier is g++ and for linking
flags I have: -fPIC -shared.

When I try to run my application on Linux, it loads up the first shared
library lib1 correctly but when it tries to load the second one lib2 it
complains about unresolved symbols, the ones that were defined in lib1. When
I compiled all the code and made it lib1, the application worked but for
this project it is required that I have multiple shared libraries. So is
there a way to build these libraries that are dependent on each other so
that I won't have the unresolved symbols problem or is there a way in Java
to load up all the libraries simultaneously? Any help is appreciated.
Thanks,

Johnny

 
 
 

Help with building shared libraries with dependencies on other shared libraries

Post by bdonla » Tue, 13 Nov 2001 08:00:45



> Hi all,

> I'm having problems running my application in Linux (RedHat 7.1) that
> loads up ten shared libraries, all but one have dependencies with the
> other shared libraries. The application is written in Java, so in the code
> I load up the libraries using

> System.loadLibrary("lib1");

> The libraries are written in C++ and I'm using VIDE (integrated
> development environment) to create my makefile. The complier is g++ and
> for linking flags I have: -fPIC -shared.

> When I try to run my application on Linux, it loads up the first shared
> library lib1 correctly but when it tries to load the second one lib2 it
> complains about unresolved symbols, the ones that were defined in lib1.
> When I compiled all the code and made it lib1, the application worked but
> for this project it is required that I have multiple shared libraries. So
> is there a way to build these libraries that are dependent on each other
> so that I won't have the unresolved symbols problem or is there a way in
> Java to load up all the libraries simultaneously? Any help is appreciated.
> Thanks,

> Johnny

-llibraryname?

--
make me
---
make: *** No rule to make target `me'.  Stop.

 
 
 

1. Will strip(debug shared library) == nodebug shared library ?

compiling the C++ code without debug option to produce object
files(.o) and then producing the shared library with them. Say, the
size of this library is SIZE_SO_NoD.

compiling the C++ code with debug option to produce object files(.o)
and then producing the shared library with them. Then, do 'strip
library_name'. Say, the size of this library is SIZE_SO_D.

Will SIZE_SO_NoD & SIZE_SO_D be exactly/almost equal ? If yes/no, why?
Also, what exactly 'mcs -d library_name' do? Does it reduce symbols
from the shared library which was produced without debug option also?

2. cmsg cancel <ab512dd8.0406182335.14a51b10@posting.google.com>

3. Question: Inclusion of shared libraries during linking of shared libraries

4. On Line Tech Support

5. Shared library loading shared library.

6. confuse over sendmail

7. Need a Shared Library Guru: beyond simple shared library question

8. Paradise II (2.0.1) client (Netrek) for Linux ??? HELP PLEASE !

9. When is a shared library not a shared library?

10. Building shared library which includes static libraries

11. Building shared libraries that contain static libraries.

12. Using libtool to build shared libraries that depend on static libraries

13. HELP: building a shared library / mkimage ?