From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29442 invoked by alias); 10 Sep 2004 17:54:07 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 29392 invoked from network); 10 Sep 2004 17:54:03 -0000 Received: from unknown (HELO baldur.globalsymmetry.com) (66.92.149.152) by sourceware.org with SMTP; 10 Sep 2004 17:54:03 -0000 Received: from ljosalfr.globalsymmetry.com (ljosalfr.globalsymmetry.com [192.168.0.27]) by baldur.globalsymmetry.com (8.12.3/8.12.3/SuSE Linux 0.6) with ESMTP id i8AHtLEm007002 for ; Fri, 10 Sep 2004 13:55:21 -0400 Received: from ljosalfr.globalsymmetry.com (localhost [127.0.0.1]) by ljosalfr.globalsymmetry.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id i8AHrUSk025431 for ; Fri, 10 Sep 2004 13:53:30 -0400 Received: from localhost (localhost [[UNIX: localhost]]) by ljosalfr.globalsymmetry.com (8.12.10/8.12.10/Submit) id i8AHrUOF025430 for gcc@gcc.gnu.org; Fri, 10 Sep 2004 13:53:30 -0400 X-Authentication-Warning: ljosalfr.globalsymmetry.com: hattons set sender to hattons@globalsymmetry.com using -f From: "Steven T. Hatton" Organization: Global Symmetry To: gcc@gcc.gnu.org Subject: Re: Fwd: Linking public: static const members in lib*.a's Date: Fri, 10 Sep 2004 18:12:00 -0000 User-Agent: KMail/1.7 References: <200409100243.19933.hattons@globalsymmetry.com> <200409100616.46719.hattons@globalsymmetry.com> <200409100639.52561.hattons@globalsymmetry.com> In-Reply-To: <200409100639.52561.hattons@globalsymmetry.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200409101353.30041.hattons@globalsymmetry.com> X-SW-Source: 2004-09/txt/msg00632.txt.bz2 On Friday 10 September 2004 06:39, Steven T. Hatton wrote: It was suggested that I run nm -C on my libraries. That revealed that=20 sth::util::RgbColor::RED was undefined in the ColorTest.o. I added the=20 library containing RgbColor.o with -l and its path with -L. That enabled t= he=20 linker to find what it needed.=20=20 I guess this means that a lib*.a isn't "cumulative" in that it only referen= ces=20 names in the libraries linked into it. Where can I learn more about what=20 things such as this stuff from the nm man page? "A" The symbol's value is absolute, and will not be changed by further linking. "B" The symbol is in the uninitialized data section (known as BSS). "C" The symbol is common. Common symbols are unini=AD tialized data. When linking, multiple common sym=AD bols may appear with the same name. If the symbol is defined anywhere, the common symbols are treated as undefined references. This is the nm stuff that gave me the clue I needed. RgbColor.o: 000001d4 t global constructors keyed to _ZN3sth4util8RgbColorC2ERKhS3_S3_ 0000011a t __static_initialization_and_destruction_0(int, int) 00000000 W sth::util::Printable_IF::Printable_IF() 00000000 W sth::util::Printable_IF::~Printable_IF() 00000000 W sth::util::Printable_IF::~Printable_IF() 00000000 W sth::util::Printable_IF::~Printable_IF() 00000000 B sth::util::RgbColor::RED 00000040 T sth::util::RgbColor::RgbColor(unsigned char const&, unsigned cha= r=20 const&, unsigned char const&) 00000000 T sth::util::RgbColor::RgbColor(unsigned char const&, unsigned cha= r=20 const&, unsigned char const&) 00000000 W sth::util::RgbColor::~RgbColor() 00000000 W sth::util::RgbColor::~RgbColor() 00000080 T sth::util::RgbColor::print(std::basic_ostream >&) const U std::basic_ostream >::operator<<(in= t) 00000000 V std::basic_streambuf >::_S_pback_si= ze 00000000 V std::basic_streambuf=20 >::_S_pback_size U std::ios_base::Init::Init() U std::ios_base::Init::~Init() 00000008 b std::__ioinit U std::basic_ostream >& std::operator= <<=20 >(std::basic_ostream >= &,=20 char const*) 00000000 V typeinfo for sth::util::Printable_IF 00000000 V typeinfo for sth::util::RgbColor 00000000 V typeinfo name for sth::util::Printable_IF 00000000 V typeinfo name for sth::util::RgbColor U vtable for __cxxabiv1::__class_type_info U vtable for __cxxabiv1::__si_class_type_info 00000000 V vtable for sth::util::Printable_IF 00000000 V vtable for sth::util::RgbColor U operator delete(void*) U __cxa_atexit U __cxa_pure_virtual U __dso_handle U __gxx_personality_v0 000001a4 t __tcf_0 000001bc t __tcf_1 ColorTest.o: 0000012e t global constructors keyed to _ZN3sth9ColorTestC2ERSo U _Unwind_Resume 000000d8 t __static_initialization_and_destruction_0(int, int) 00000000 W sth::util::Printable_IF::Printable_IF(sth::util::Printable_IF=20 const&) 00000000 W sth::util::Printable_IF::~Printable_IF() 00000000 W sth::util::Printable_IF::~Printable_IF() 00000000 W sth::util::Printable_IF::~Printable_IF() U sth::util::RgbColor::RED 00000000 W sth::util::RgbColor::RgbColor(sth::util::RgbColor const&) 00000000 W sth::util::RgbColor::~RgbColor() 00000000 W sth::util::operator<<(std::basic_ostream >&, sth::util::Printable_IF const&) 00000066 T sth::ColorTest::ColorTest(std::basic_ostream >&) 00000000 T sth::ColorTest::ColorTest(std::basic_ostream >&) 000000d2 T sth::ColorTest::~ColorTest() 000000cc T sth::ColorTest::~ColorTest() 00000000 V std::basic_streambuf >::_S_pback_si= ze 00000000 V std::basic_streambuf=20 >::_S_pback_size U std::ios_base::Init::Init() U std::ios_base::Init::~Init() 00000000 b std::__ioinit 00000000 V typeinfo for sth::util::Printable_IF 00000000 V typeinfo name for sth::util::Printable_IF U vtable for __cxxabiv1::__class_type_info 00000000 V vtable for sth::util::Printable_IF U vtable for sth::util::RgbColor U operator delete(void*) U __cxa_atexit U __cxa_pure_virtual U __dso_handle U __gxx_personality_v0 00000116 t __tcf_0 --=20 Regards, Steven