how can cout be undeclared?

Kayvan A. Sylvan kayvan@sylvan.com
Fri Feb 8 14:14:00 GMT 2002


On Fri, Feb 08, 2002 at 01:57:05PM -0600, Kirk wrote:
> I'm trying to a program ported from linux (redhat7.2 running gcc-2.96RH) to 
> freebsd. I have installed gcc-3.0. Most of the compile time errors that I was 
> getting while using gcc-2.95 on freebsd have disappeared now that I'm 
> compiling with gcc-30. However, there is one that is perplexing me. It is:
> 
> tveg.cpp: In member function `void TVeg::dayOut(TDay*)':
> tveg.cpp:428: `cout' undeclared (first use this function)
> tveg.cpp:428: (Each undeclared identifier is reported only once for each
>    function it appears in.).... 
> 
> the whole error output is below. 
> 
> It is odd that a simple cout (which compiles fine on redhat's 2.96 version) 
> is choking here.
> 
> Any thoughts?
> 
> Thanks in advance,
> 
> Kirk

This is correct behavior. gcc-2.X was not quite standard-conforming.

Add a "using std::cout;" statement and all should be well.

			---Kayvan
-- 
Kayvan A. Sylvan          | Proud husband of       | Father to my kids:
Sylvan Associates, Inc.   | Laura Isabella Sylvan  | Katherine Yelena (8/8/89)
http://sylvan.com/~kayvan | "crown of her husband" | Robin Gregory (2/28/92)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20020208/9f807c0f/attachment.sig>


More information about the Gcc-help mailing list