This is the mail archive of the
mailing list for the binutils project.
Re: Problems with shared library linking and pthreads
- From: Erland Lewin <erl at voxi dot com>
- To: Daniel Jacobowitz <drow at mvista dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 08 Aug 2002 16:23:16 +0200
- Subject: Re: Problems with shared library linking and pthreads
- References: <3D526EAD.email@example.com> <20020808132757.GA2602@nevyn.them.org>
You're right; shared libraries must be linked with the shared libraries
that they use. All shared libraries that they use, which includes libc
and often libgcc_s. The rule is, don't ever use "ld" to link a shared
library. You should only be doing that for custom static binaries, if
ever. Use "cc -shared testlib.o -lpthread -o libtestlib.so" (and maybe
-Wl,-soname,libtestlib.so") and see if that helps.
Thanks, that solved it!