public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Undefined reference : very strange linking problem...
@ 2004-09-06 10:06 Sébastien ZINSIUS
       [not found] ` <1E58066E82C558488E7F316C6D6B34DF01081E@srv1.ersa-france.co m>
  0 siblings, 1 reply; 2+ messages in thread
From: Sébastien ZINSIUS @ 2004-09-06 10:06 UTC (permalink / raw)
  To: gcc-help

Hello all!

I have a very strange linking problem... I'm working on a quite complex project written in C++ and compiled/linked with g++.

This project includes a lot of libraries. I recently added 3 new classes (one base class and two classes inheriting the first) to the A library. This library is used by library B. Finally, application is linked with both libraries.

Everything worked sofar but this times I got strange undefined references when linking (only with the two classes inheriting the third, but I don't know if it is related). I checked header files (#ifdef, class names, method names...), libraries linking order (but that always worked...) and everything is OK. Compilation also succeeds and when I use classes directly (not through libraries) or when I use them through library A it works!!

That's why I suspect something with library B. It seems that there is an overflow somewhere (to many symbols defined in library)... Is this possible? Is there any solution? Any other idea?

Thanks in anticipation!

Sébastien

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

* Re: Undefined reference : very strange linking problem...
       [not found] ` <1E58066E82C558488E7F316C6D6B34DF01081E@srv1.ersa-france.co m>
@ 2004-09-07 12:36   ` Eljay Love-Jensen
  0 siblings, 0 replies; 2+ messages in thread
From: Eljay Love-Jensen @ 2004-09-07 12:36 UTC (permalink / raw)
  To: Sébastien ZINSIUS, gcc-help

Hi Sebastien,

Could be a "too many symbols" overflow.

Could be an interdependency between library A and B (usually "a bad thing").

Try this:

g++ -o foo myapp.o libA.a libB.a libA.a

That will help if there are library interdependencies.

HTH,
--Eljay

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

end of thread, other threads:[~2004-09-07 12:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-06 10:06 Undefined reference : very strange linking problem Sébastien ZINSIUS
     [not found] ` <1E58066E82C558488E7F316C6D6B34DF01081E@srv1.ersa-france.co m>
2004-09-07 12:36   ` Eljay 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).