public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Linking static libs into shared libs
@ 2002-12-18  2:07 Alexander.Schmid
  2002-12-18  7:06 ` John Love-Jensen
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander.Schmid @ 2002-12-18  2:07 UTC (permalink / raw)
  To: gcc-help

Hi everybody,

I´m trying to create a shared lib, that needs some static libs to be created.
But when I try to link the shared lib against an executable, I get unresolved
externals.
Can anybody tell me what I did wrong? Is the "tunneling" of functions of a
static lib through the shared lib not possible?

Here´s the situation (well, lets say what I did) in Detail:

- creating the static lib:    g++ -c libstatic.cpp
               ar rcs libstatic.a libstatic.o
-creating the shared lib: g++ -c -fPIC libshared.cpp
               g++ -shared -o libShared.so -static -lstatic -lanotherstatic

I hope someone can help me.

Thanks in advance,
Alex





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

* Re: Linking static libs into shared libs
  2002-12-18  2:07 Linking static libs into shared libs Alexander.Schmid
@ 2002-12-18  7:06 ` John Love-Jensen
  0 siblings, 0 replies; 2+ messages in thread
From: John Love-Jensen @ 2002-12-18  7:06 UTC (permalink / raw)
  To: Alexander.Schmid, gcc-help

Hi Alex,

What does the 'nm' and/or 'objdump' commands tell you about libShared.so,
libstatic.a and libanotherstatic.xxx?

You do realize that order is important, so if libanotherstatic.xxx has
dependencies in libstatic.a that they may not be resolved correctly.

Can you contrive a minimal toy example that exhibits this behavior?

--Eljay

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

end of thread, other threads:[~2002-12-18 12:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-18  2:07 Linking static libs into shared libs Alexander.Schmid
2002-12-18  7:06 ` John Love-Jensen

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).