public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/7672: can't compile c++ files
@ 2002-08-22 16:16 Gabriel Dos Reis
0 siblings, 0 replies; 3+ messages in thread
From: Gabriel Dos Reis @ 2002-08-22 16:16 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/7672; it has been noted by GNATS.
From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: bradshaw@mcs.anl.gov
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/7672: can't compile c++ files
Date: 23 Aug 2002 00:57:32 +0200
bradshaw@mcs.anl.gov writes:
| >Class: rejects-legal
The testcase you submitted is invalid since the standard library is
now in namespace std as required.
| >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;
This is invalid: entities from the Standard library are placed in the
standard namespace; and the above should read:
std::cout << "hello WOrld" << std::endl;
-- Gaby
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c++/7672: can't compile c++ files
@ 2002-08-20 21:16 pme
0 siblings, 0 replies; 3+ messages in thread
From: pme @ 2002-08-20 21:16 UTC (permalink / raw)
To: bradshaw, gcc-bugs, gcc-prs, nobody
Synopsis: can't compile c++ files
State-Changed-From-To: open->closed
State-Changed-By: pme
State-Changed-When: Tue Aug 20 20:42:23 2002
State-Changed-Why:
Your code is no longer valid C++ (and hasn't been,
technically, since 1998). When using elements from the
std namespace, you must qualify them:
std::cout << "blah" << std::endl;
A good c++ textbook will explain further.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7672
^ permalink raw reply [flat|nested] 3+ messages in thread
* c++/7672: can't compile c++ files
@ 2002-08-20 20:42 bradshaw
0 siblings, 0 replies; 3+ messages in thread
From: bradshaw @ 2002-08-20 20:42 UTC (permalink / raw)
To: gcc-gnats
>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:
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-08-22 23:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-22 16:16 c++/7672: can't compile c++ files Gabriel Dos Reis
-- strict thread matches above, loose matches on Subject: below --
2002-08-20 21:16 pme
2002-08-20 20:42 bradshaw
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).