This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Weird error message
- From: Phil Edwards <phil at jaj dot com>
- To: Hermione Granger <herm_oh_ninny at hotmail dot com>
- Cc: gcc at gnu dot org
- Date: Mon, 16 Sep 2002 12:27:33 -0400
- Subject: Re: Weird error message
- References: <F26juyYT9sdER01mBGk0000ff10@hotmail.com>
On Sat, Sep 14, 2002 at 08:27:34PM +0100, Hermione Granger wrote:
> Dear Gcc creators,
>
> This is the error message I get compiling the attached program.
>
> [xxxxx@xxxxxxxxx xx]$ g++ fork.cpp -o fork
> fork.cpp: In function `int main (int, char **)':
> fork.cpp:8: `cout' undeclared (first use this function)
> fork.cpp:8: (Each undeclared identifier is reported only once for each
> function it appears in.)
Entities like cout are in namespace std since 1998. Write std::cout
instead. (There are shorter and less repetitive ways, but this is not a
C++ teaching group. You need a decent C++ textbook; I'm sure they have
them in Diagon Alley.)
> I am running Redhat Linux 7.2 and GCC version 2.96(not upgraded). Please
> tell me what's going on.
http://gcc.gnu.org/gcc-2.96.html
Phil
--
I would therefore like to posit that computing's central challenge, viz. "How
not to make a mess of it," has /not/ been met.
- Edsger Dijkstra, 1930-2002