Building a Shared Library

Building a Shared Library

Post by John Willia » Fri, 13 Oct 2000 04:00:00



Hi,

  I'm trying to build a shared lib using Sol2.6 and SC4.2. I can get it built
but the result crashes. It links other libs, both shared and static (.a), and
my source is compiled with the -mt switch.

  When I run it I get

%testapp
libc internal error: _rmutex_unlock: rmutex not held.

  So, is this because I'm linking libs that were not built for a shared object,
i.e. no -pic? Or is it some threading issue I can overcome? It seems to run OK
until it makes a call to one of the underlying libs.

  Also, if I have some multithreaded libs in the link does that mean they all
have to be -mt as well?

Thanks,
John W

  Remove the X in the address to respond via CC.

 
 
 

Building a Shared Library

Post by Andy Plat » Sat, 14 Oct 2000 04:00:00


The restriction I've found is that the application itself must be built
with -mt.

Andy.

--
I'm not really here - it's just your warped imagination.

Quote:> Hi,

>   I'm trying to build a shared lib using Sol2.6 and SC4.2. I can get it
built
> but the result crashes. It links other libs, both shared and static (.a),
and
> my source is compiled with the -mt switch.

>   When I run it I get

> %testapp
> libc internal error: _rmutex_unlock: rmutex not held.

>   So, is this because I'm linking libs that were not built for a shared
object,
> i.e. no -pic? Or is it some threading issue I can overcome? It seems to
run OK
> until it makes a call to one of the underlying libs.

>   Also, if I have some multithreaded libs in the link does that mean they
all
> have to be -mt as well?

> Thanks,
> John W

>   Remove the X in the address to respond via CC.


 
 
 

1. Help with building shared libraries with dependencies on other shared libraries

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

2. latest compatibility list for Network card

3. Building shared library which includes static libraries

4. No route to host

5. Building shared libraries that contain static libraries.

6. 24bit PCI Ultra 5

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

8. Frame buffer and G200

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

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

11. Shared library loading shared library.

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

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