c++/7672: can't compile c++ files

bradshaw@mcs.anl.gov bradshaw@mcs.anl.gov
Tue Aug 20 20:06:00 GMT 2002


>Number:         7672
>Category:       c++
>Synopsis:       can't compile c++ files
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 20 20:06:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        3.2
>Organization:
>Environment:
System: Linux jedi.prototype8.net 2.4.18-5 #1 Mon Jun 10 15:31:48 EDT 2002 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ./configure --prefix=/home/rick/gcc-3.2 --with-threads=posix
>Description:
I write a simple hello world program with cout and include iostream and it doesn't compile and claims unknown identifier cout.
#include <iostream>

int main() {
        cout << "hello WOrld" << endl;
        return 0;
}

gccbuildtest.cpp: In function `int main()':
gccbuildtest.cpp:5: `cout' undeclared (first use this function)
gccbuildtest.cpp:5: (Each undeclared identifier is reported only once for each
   function it appears in.)
gccbuildtest.cpp:5: `endl' undeclared (first use this function)

>How-To-Repeat:
>Fix:
   I am not sure how to fix but I have seen this problem ever since gcc-3.1
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list