delorie.com/archives/browse.cgi | search |
From: | "John M. Aldrich" <fighteer AT cs DOT com> |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: Newbie iostream problem. |
Date: | Sun, 06 Jul 1997 21:54:06 +0000 |
Organization: | Two pounds of chaos and a pinch of salt |
Lines: | 31 |
Message-ID: | <33C013FE.153E@cs.com> |
References: | <01bc89ce$6ffab1a0$542d18ce AT johnsoth DOT carleton DOT edu> |
Reply-To: | fighteer AT cs DOT com |
NNTP-Posting-Host: | ppp208.cs.com |
Mime-Version: | 1.0 |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Ted Johnson wrote: > > c:/djgpp/tmp\ccdaaaaa(.text+0x22):work.cc: undefined reference to `cout' > c:/djgpp/tmp\ccdaaaaa(.text+0x27):work.cc: undefined reference to `ostream::operator<<(char const *)' > > This compiles without problem under Visual C++ 5 and g++ on my unix shell > account. What am I doing wrong? You aren't linking the C++ libraries when you compile your program. You must do one of the following: - Add '-lgpp' to the end of your compilation command line: gcc -o myprog.exe myprog.cc -lgpp - Use the 'gxx' program which does this for you: gxx -o myprog.exe myprog.cc FYI, this is mentioned in the 'readme.1st' file; I suggest you look at it. hth -- --------------------------------------------------------------------- | John M. Aldrich | "Animals can be driven crazy by pla- | | aka Fighteer I | cing too many in too small a pen. | | mailto:fighteer AT cs DOT com | Homo sapiens is the only animal that | | http://www.cs.com/fighteer | voluntarily does this to himself." | ---------------------------------------------------------------------
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |