From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: Problems Date: Mon, 09 Mar 1998 23:25:27 -0500 Organization: Two pounds of chaos and a pinch of salt. Lines: 28 Message-ID: <3504C0B7.37BF@cs.com> References: <3503100B DOT 1B72B57B AT jove DOT acs DOT unt DOT edu> NNTP-Posting-Host: ppp215.cs.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Tim Faehnle wrote: > > C:\DJGPP\BIN\gcc -g -o test test.cc > c:/djgpp/tmp\ccdaaaaa: In function 'main': > test.cc:12: undefined reference to 'cout' > test.cc:(.text+0x49): undefined reference to > 'ostream::operator<<(double)' > > I would appreciate a response. Thank you very much. If you study 'readme.1st' carefully, you'll see that you have to use a different command line to compile C++ programs, because the linker doesn't have any way to know that it needs to link the C++ libraries. Specifically, add "-lgpp" to the end of your command line, or use 'gxx' instead of 'gcc' which does this for you. You can use "-lstdcx" or "-liostr" instead of "-lgpp" (for gcc 2.8.0, use "-lstdcxx"; "-liostr" no longer exists). The readme does need to be updated for gcc 2.8.0... -- --------------------------------------------------------------------- | John M. Aldrich | "History does not record anywhere at | | aka Fighteer I | any time a religion that has any | | mailto:fighteer AT cs DOT com | rational basis." | | http://www.cs.com/fighteer | - Lazarus Long | ---------------------------------------------------------------------