public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Statically linking in a static library
@ 2011-12-19 21:21 Anthony Weston
  2011-12-20  5:38 ` Ian Lance Taylor
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony Weston @ 2011-12-19 21:21 UTC (permalink / raw)
  To: gcc-help

Hi,

I'm having trouble with statically linking.  I've created a static
library that statically links to other static libraries.  My hope by
doing this was so other users would only need to include one static
library when linking in their executable.  However when I nm the
created the static library all the references are unresolved.  Is
there an argument that will force the linker to resolve these symbols?

Example:

libA.a defines functionA.
libB.a defines functionB.

I create libC.a which statically links and uses both libA.a and libB.a.

When running nm libC.a the results show that neither functionA nor
functionB can be resolved so libA.a and libB.a also need to be
statically linked into the final executable.

Thank you,
Tony

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

end of thread, other threads:[~2011-12-20 15:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-19 21:21 Statically linking in a static library Anthony Weston
2011-12-20  5:38 ` Ian Lance Taylor
2011-12-20 16:02   ` Joel Dice

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 read-only IMAP folder(s) and NNTP newsgroup(s).