This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Weird error message


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]