Newsgroups: comp.os.msdos.djgpp From: manni DOT heumann AT gmx DOT de (Manni Heumann) Subject: Re: String References: <3891087C DOT 624C5D1A AT americasm10 DOT nt DOT com> X-Newsreader: News Xpress 2.01 Date: Fri, 28 Jan 2000 10:20:55 GMT NNTP-Posting-Host: dhcp33-226.uni-bielefeld.de Message-ID: <38916d8d$1@news.uni-bielefeld.de> X-Trace: 28 Jan 2000 11:21:01 +0200, dhcp33-226.uni-bielefeld.de Lines: 26 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com In article <3891087C DOT 624C5D1A AT americasm10 DOT nt DOT com>, ichapman AT nortelnetworks DOT com wrote: >Hi all, > I'd like to use the String objects which are part of cpp and >libgpp.a. The line ***String x = "abcdetc";*** compiles fine. The >Linker is undefined reference to String::String(char const *). I >figured I'd got incompatible versions of the various files. I have >gcc 2.81 119,808 June 6-98 >libgpp.a 394,290 June 6-98 >ld 2.8.1 316,982 July 16-97 To get the version I used --version >flag. > .. I guess your library is OK, and I figured you tried to link with libgpp.a The strange thing is, that you will have to compile with some optimizations. Otherwise some inline functions will not get inlined and then the linker won't find them. Don't ask why, I know it's strange. So your call to gcc should look something like this: gxx myprog.cpp -O -lgpp -- Manni