From: "Michael Stewart" Newsgroups: comp.os.msdos.djgpp Subject: Re: getting gcc to work with C++ classes Date: Fri, 27 Aug 1999 08:44:24 +0100 Organization: (Posted via) Netcom Internet Ltd. Lines: 27 Message-ID: <7q5fl2$dek$1@taliesin.netcom.net.uk> References: <37C61861 DOT 832BAEDF AT asan DOT com> NNTP-Posting-Host: hgty.capgemini.co.uk X-Trace: taliesin.netcom.net.uk 935739874 13780 194.42.240.2 (27 Aug 1999 07:44:34 GMT) X-Complaints-To: abuse AT corp DOT netcom DOT net DOT uk NNTP-Posting-Date: 27 Aug 1999 07:44:34 GMT X-Newsreader: Microsoft Outlook Express 4.72.3155.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com G Jaye wrote in message <37C61861 DOT 832BAEDF AT asan DOT com>... >I'm a teacher and many of my C++ students will have Win98 systems. To >that end, I just installed GNU's package (using its Win 9x hard disk >installation program) on my Win98 system's E drive, and everything seems >pretty well-behaved except the C++ aspect of the DJGPP gcc compiler, ver >2.7.2. (C works just fine!) Consider the statement below, given the >directive #include and source file extensions cc, cpp, and >cxx (I tried all 3). > > cout << "Hello world\n"; > >The 2 error messages this produces are: >1. undefined reference to 'cout' >2. undefined reference to 'ostream::operator<<(chr const *) > >Clearly iostream.h is being found or the 2 error messages wouldn't >occur. Yet it doesn't seem to do any good. The only copy of iostream.h >is in the E:\fsf\lang\cxx directory. Attempts to use the C++ string >class declared in fare no better. Am I better off re-installing >from the DJGPP web site or elsewhere? Hoping somebody can get tell me >how to resolve this before Sept 9!!!Thanks... It sounds like you are not linking in the C++ library (FAQ 8.7). Either link with -lstdcxx or use gxx to do it for you.