This is the mail archive of the gcc-help@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: GCC compiler in Red Hat 9


cout is in the "std" namespace.  So, you either need to add a "using namespace std;" statement after your include statement, or refer to cout as std::cout.

Cheers,
Lyle


-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org]On
Behalf Of Hasan Shibly
Sent: Monday, January 12, 2004 12:57 PM
To: gcc-help@gcc.gnu.org
Subject: GCC compiler in Red Hat 9


Hello,

I have just installed Red Hat 9 (Fresh installation on a dual boot
system with Win XP) on my system.

For some reason g++ compiler is giving me errors, even for the simple
"Hello world" program.

#include <iostream>
int main()
{
cout << "hello world";
return EXIT_SUCCESS;
}

Below is the compilation error I am facing.

$ g++ test.cpp

test.cpp:5: 'cout' undeclared (first use this function)
test.cpp:5: (Each undeclared identifier is reported only once for each
function it appears in.)

Your help is highly appreciated.

Regards
H@z@n


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