linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Why does linking a.so with b.so require execs to be linked both -la and -lb?
@ 2003-08-11 21:02 David Wuertele
  2003-08-11 23:50 ` Mike Castle
  2003-08-12 13:16 ` Glynn Clements
  0 siblings, 2 replies; 9+ messages in thread
From: David Wuertele @ 2003-08-11 21:02 UTC (permalink / raw)
  To: linux-c-programming

#  I'm creating a shared library like this:
libDaveA.so: $(LIB_OBJECTS)
	$(CXX) -shared -ldl -rdynamic -o $@ $^ -lDaveB -lDaveC -lDaveD -lDaveE

#  And I have some executables that use the shared lib:
daveprog: daveprog.cpp
	$(CXX) -o $@ $^ -lDaveA

The executable doesn't use any of the functions from libDaveB.so,
libDaveC.so, libDaveD.so, or libDaveE.so.  It only uses functions from
libDaveA.so.  But when I compile with the above makefile, gcc
complains:

  /usr/tools/lib/gcc-lib/mipsel-linux/2.96/../../../../mipsel-linux/bin/ld: warning: libDaveB.so.0, needed by /usr/local/lib/libDaveA.so, not found (try using -rpath or -rpath-link)

Why is that?  Why should daveprog, which never uses any functionality
AT ALL from libDaveB.so, have to link to it?

Dave


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-08-12 19:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-11 21:02 Why does linking a.so with b.so require execs to be linked both -la and -lb? David Wuertele
2003-08-11 23:50 ` Mike Castle
2003-08-12  0:10   ` David Wuertele
2003-08-12 13:49     ` Glynn Clements
2003-08-12 16:42       ` David Wuertele
2003-08-12 17:54         ` Glynn Clements
2003-08-12 19:12         ` Steven
2003-08-12  0:11   ` David Wuertele
2003-08-12 13:16 ` Glynn Clements

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).