RE: GCC compiler in Red Hat 9

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx [mailto:gcc-help-owner@xxxxxxxxxxx]On
Behalf Of Hasan Shibly
Sent: Monday, January 12, 2004 12:57 PM
To: gcc-help@xxxxxxxxxxx
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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux