From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29979 invoked by alias); 7 Feb 2003 12:33:33 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 29967 invoked from network); 7 Feb 2003 12:33:32 -0000 Received: from unknown (HELO s-vie1-11.psc.com) (62.99.145.130) by 172.16.49.205 with SMTP; 7 Feb 2003 12:33:32 -0000 Received: from [192.168.1.128] (192.168.1.128 [192.168.1.128]) by s-vie1-11.psc.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 1M91GP0H; Fri, 7 Feb 2003 13:33:23 +0100 Subject: Re: Linker trouble From: Eilmsteiner Reinhard To: Miguel =?ISO-8859-1?Q?Ram=EDrez?= Cc: gcc-help@gcc.gnu.org In-Reply-To: <002501c2ce85$c2201590$ab3791c1@mtg171> References: <23FD0445E7F1D4119D910002A50981138D19AC@s-vie1-11.psc.com> <002501c2ce85$c2201590$ab3791c1@mtg171> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: Fri, 07 Feb 2003 12:33:00 -0000 Message-Id: <1044621302.2697.21.camel@vie-nb-eilm2> Mime-Version: 1.0 X-SW-Source: 2003-02/txt/msg00076.txt.bz2 Hi and thx for the hint! However I still can't see what goes wrong. So here is what I wrote and what I get from it: 1st (Main-) Makefile: CC=3Dg++ BINDIR=3D../../bin INCLUDEDIR=3D../../include LIBSDIR=3D../../lib CCOPTS=3D-ggdb -I$(INCLUDEDIR) -L$(LIBSDIR) .PHONY default: prepare prepare: logserver cp logserver $(BINDIR) logserver: main.o $(CC) $(CCOPTS) -o logserver main.o clogserver.o clogserverexception.o -lclasslogging -lclassgeneral main.o: clogserver.o main.cc $(CC) $(CCOPTS) -c main.cc clogserver.o: classliblogging clogserverexception.o definitions.h clogserver.cc clogserver.h $(CC) $(CCOPTS) -c clogserver.cc clogserverexception.o: classlibgeneral clogserverexception.cc clogserverexception.h $(CC) $(CCOPTS) -c clogserverexception.cc classliblogging: make -C ../classliblogging classlibgeneral: make -C ../classlibgeneral 2nd Makefile (for libclassgeneral): CC=3Dg++ INCLUDEDIR=3D../../include LIBDIR=3D../../lib CCOPTS=3D-ggdb -I$(INCLUDEDIR) .PHONY default: prepare prepare: classlibgeneral.a classlibgeneral.h cp libclassgeneral.a $(LIBDIR) mkdir -p $(INCLUDEDIR)/classlibgeneral cp *.h $(INCLUDEDIR)/classlibgeneral mv $(INCLUDEDIR)/classlibgeneral/classlibgeneral.h $(INCLUDEDIR) classlibgeneral.a: ccommandline.o cconfigfile.o ar rcs libclassgeneral.a *.o cstring.o: cstring.cc cstring.h $(CC) $(CCOPTS) -c cstring.cc cexception.o: cexception.cc cexception.h $(CC) $(CCOPTS) -c cexception.cc ccommandline.o: ccommandline.cc ccommandline.h $(CC) $(CCOPTS) -c ccommandline.cc cconfigfile.o: cconfigfileexception.o cconfigfilesection.o cconfigfile.cc cconfigfile.h $(CC) $(CCOPTS) -c cconfigfile.cc cconfigfileexception.o: cexception.o cconfigfileexception.cc cconfigfileexception.h $(CC) $(CCOPTS) -c cconfigfileexception.cc cconfigfilesection.o: cstringarray.o cconfigfilesection.cc cconfigfilesection.h $(CC) $(CCOPTS) -c cconfigfilesection.cc cstringarray.o: cstringlist.o cstringarray.cc cstringarray.h $(CC) $(CCOPTS) -c cstringarray.cc cstringlist.o: classtpl cstring.o cstringlist.cc cstringlist.h $(CC) $(CCOPTS) -c cstringlist.cc classtpl: make -C ../classtpl Now the results from the make (excerpt): g++ -ggdb -I../../include -L../../lib -o logserver main.o clogserver.o clogserverexception.o -lclasslogging -lclassgeneral main.o: In function `main': /home/eilmrein/Documents/proj/c/src/logserver/main.cc:27: undefined reference to `CCommandLine::CCommandLine[in-charge](int, char const**)' clogserver.o: In function `CLogServer::GoToLoggingStage(CLogServer::TLogStage, bool, CCommandLine const*)': /home/eilmrein/Documents/proj/c/src/logserver/clogserver.cc:91: undefined reference to `CString::operator()() const' /home/eilmrein/Documents/proj/c/src/logserver/clogserver.cc:91: undefined reference to `CString::~CString [in-charge]()' /home/eilmrein/Documents/proj/c/src/logserver/clogserver.cc:91: undefined reference to `CString::~CString [in-charge]()' /home/eilmrein/Documents/proj/c/src/logserver/clogserver.cc:111: undefined reference to `CString::operator()() const' And finally the result of the objdump -tc libclassgeneral.a (pretty long but excepted for the file cstring.o only): In archive libclassgeneral.a: cstring.o: file format elf32-i386 SYMBOL TABLE: 00000000 l df *ABS* 00000000 cstring.cc 00000000 l d .text 00000000=20 00000000 l d .data 00000000=20 00000000 l d .bss 00000000=20 00000000 l .text 00000000 gcc2_compiled. 00000000 l d .debug_abbrev 00000000=20 00000000 l d .debug_info 00000000=20 00000000 l d .debug_line 00000000=20 00000000 l d .rodata 00000000=20 00000000 l O .rodata 00000003 szEOL.15 00000000 l d .gnu.linkonce.d.__vt_7CString 00000000=20 00000000 l d .gnu.linkonce.t.__tf7CString 00000000=20 00000000 l d .gcc_except_table 00000000=20 00000000 l .gcc_except_table 00000000 __EXCEPTION_TABLE__ 00000000 l d .eh_frame 00000000=20 00000000 l .eh_frame 00000000 __FRAME_BEGIN__ 00000000 l d .debug_pubnames 00000000=20 00000000 l d .debug_aranges 00000000=20 00000000 l d .note 00000000=20 00000000 l d .comment 00000000=20 00000000 g F .text 00000037 CString::CString(void) 00000000 w O .gnu.linkonce.d.__vt_7CString 00000010 CString virtual table 000001c0 g F .text 00000083 CString::GetBuffer(int) 00000040 g F .text 00000065 CString::CString(char const *) 00000000 *UND* 00000000 strlen 00000000 *UND* 00000000 strcpy 000000b0 g F .text 00000039 CString::CString(CString const &) 000002f0 g F .text 0000005b CString::Copy(CString const &) 000000f0 g F .text 00000047 CString::~CString(void) 00000000 *UND* 00000000 free 00000000 *UND* 00000000 __builtin_delete 00000140 g F .text 0000005b CString::StripEOL(void) 00000250 g F .text 0000004b CString::Tail(int) const 00000000 *UND* 00000000 strchr 000002a0 g F .text 00000047 CString::CutEnd(int) 000001a0 g F .text 0000001c CString::operator()(void) const 00000000 *UND* 00000000 realloc 00000000 *UND* 00000000 malloc 00000350 g F .text 0000002e CString::GetLength(void) const 00000380 g F .text 00000075 CString::StripDelimiters(char) 00000400 g F .text 00000027 CString::operator=3D=3D(char const *) const 00000460 g F .text 0000002e CString::IsEqual(char const *) const 00000430 g F .text 00000025 CString::operator=3D(CString const &) 00000000 *UND* 00000000 strcmp 00000490 g F .text 00000033 CString::IsEmpty(void) const 000004d0 g F .text 00000045 CString::operator[](int) const 00000520 g F .text 0000005b CString::operator=3D=3D(CString const &) const 00000580 g F .text 00000045 CString::Contains(char) const 00000000 *UND* 00000000 __throw 000005d0 g F .text 000000f2 CString::PartBefore(char) const 000007d0 g F .text 00000044 CString::RemoveFrom(char) 00000000 *UND* 00000000 terminate(void) 000006d0 g F .text 000000f2 CString::PartAfter(char) const 00000820 g F .text 00000051 CString::RemoveTo(char) 00000880 g F .text 0000007f CString::Append(char const *) 00000000 *UND* 00000000 strcat 00000900 g F .text 0000009d CString::operator+(char const *) const 000009a0 g F .text 0000009d CString::operator+(CString const &) const 00000a40 g F .text 00000033 CString::operator+=3D(CString const &) 00000a80 g F .text 00000025 CString::operator+=3D(char const *) 00000ab0 g F .text 00000038 CString::operator!=3D(CString const &) const 00000af0 g F .text 00000041 CString::CutToLength(int) 00000b40 g F .text 0000006a CString::RTrim(char const *) 00000bb0 g F .text 000000bc CString::LTrim(char const *) 00000c70 g F .text 000000f2 CString::Left(int) const 00000000 *UND* 00000000 strncpy 00000d70 g F .text 00000122 CString::Right(int) const 00000ea0 g F .text 000001b3 CString::SubStr(int, int) const 00001060 g F .text 00000090 CString::PartBeforeFirstIn(char const *) const 000010f0 g F .text 000000b0 CString::PartAfterFirstIn(char const *) const 000011a0 g F .text 00000010 CString::GetBuffer(void) const 000011b0 g F .text 0000002a CString::operator!=3D(char const *) const 00000000 w F .gnu.linkonce.t.__tf7CString 00000034 CString type_info function 00000008 O *COM* 00000004 CString type_info node 00000000 *UND* 00000000 __rtti_user Looks good for my understanding? What about yours? Thx, RE On Fri, 2003-02-07 at 09:49, Miguel Ram=EDrez wrote: >=20 > Hmmm. If it's not an ABI-related issue, the Occam's razor says that > the symbols are not in the binary for some unknown reason - then the > library build system could be the culprit... check with 'objdump -t' the > contents > of the binaries symbol tables - maybe that gives you some insight. >=20 > Good luck! >=20 > Miguel Ram=EDrez. >=20 > ----- Original Message ----- > From: "Eilmsteiner Reinhard" > To: "'Miguel Ram=EDrez'" > Cc: > Sent: Thursday, February 06, 2003 12:14 PM > Subject: RE: Linker trouble >=20 >=20 >=20 > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 >=20 > Yes, unfortunately they are.... > Do you have other ideas? >=20 > Regards, > Reinhard. >=20 > - -----Original Message----- > From: Miguel Ram=EDrez [mailto:mramirez@iua.upf.es] > Sent: Thursday, February 06, 2003 11:39 AM > To: Eilmsteiner Reinhard; gcc-help@gcc.gnu.org > Subject: Re: Linker trouble >=20 >=20 > Are the libraries 'classlogging' and 'classgeneral' compiled with the same > gcc version? >=20 > Remember that 3.2 C++ ABI is incompatible with the one of previous releas= es, > so recompiling > the libraries should do the trick. >=20 > Miguel. >=20 > - ----- Original Message ----- > From: "Eilmsteiner Reinhard" > To: > Sent: Thursday, February 06, 2003 9:27 AM > Subject: Linker trouble >=20 >=20 > > > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA1 > > > > Hi! > > > > I'm trying to link a program which used to work on a older version of g= cc > > and ld.... Now I have gcc 3.2 and ld 2.13.90.0.2 > > After all has been compiled (including the libraries classlogging and > class > > general (the latter uses the former) a do: > > g++ -ggdb -I../../include -L../../lib -o logserver main.o clogserver.o > > clogserverexception.o -lclasslogging -lclassgeneral > > and get: > > main.o: In function `main': > > /home/eilmrein/Documents/proj/c/src/logserver/main.cc:27: undefined > > reference to `CCommandLine::CCommandLine[in-charge](int, char const**)' > > clogserver.o: In function > > `CLogServer::GoToLoggingStage(CLogServer::TLogStage, bool, CCommandLine > > const*)': > > /home/eilmrein/Documents/proj/c/src/logserver/clogserver.cc:91: undefin= ed > > reference to `CString::operator()() const' > > /home/eilmrein/Documents/proj/c/src/logserver/clogserver.cc:91: undefin= ed > > reference to `CString::~CString [in-charge]()' > > /home/eilmrein/Documents/proj/c/src/logserver/clogserver.cc:91: undefin= ed > > reference to `CString::~CString [in-charge]()' > > /home/eilmrein/Documents/proj/c/src/logserver/clogserver.cc:111: undefi= ned > > reference to `CString::operator()() const' > > /home/eilmrein/Documents/proj/c/src/logserver/clogserver.cc:111: undefi= ned > > reference to `CString::~CString [in-charge]()' > > /home/eilmrein/Documents/proj/c/src/logserver/clogserver.cc:111: undefi= ned > > reference to `CString::~CString [in-charge]()' > > > > When I do a "nm -C libclassgeneral.a" I can see these member functions > > however. > > Does it have anything to do with those [in-charge]/[not-in-charge] tags, > > which I've not seen on my old version. (Please explain!) > > > > How do I get my program linked again? > > > > Thx, > > Reinhard. > > > > -----BEGIN PGP SIGNATURE----- > > Version: PGPfreeware 7.0.3 for non-commercial use > > > > iQA/AwUBPkIceFaO5+5ahqodEQLqhgCg4aUag+SIvqU3sCM0UcpaqpYb6pIAnRnG > > Hll3+bgudQyOQCQ6enbQtRS0 > > =3De2oI > > -----END PGP SIGNATURE----- > > >=20 > -----BEGIN PGP SIGNATURE----- > Version: PGPfreeware 7.0.3 for non-commercial use >=20 > iQA/AwUBPkJDqlaO5+5ahqodEQINvQCdElDZUfq3zyZrVg/ymfytDxaPc1gAoPez > IZSPbnSBX+Powu2lxbOQLnR4 > =3D3H8A > -----END PGP SIGNATURE----- >=20