Peter wrote:


My g++ compiler seems to be misconfigured. It is gcc/g++ 3.3.3 from Debian and it cannot find simple things, like cout. Example:

/usr/include/c++/3.3/iostream contains:

    extern ostream cout;

My test program is:

#include <iostream>

You are using the unsuffixed "iostream". All unsuffixed standard headers reside in the "std" namespace.

Either switch to "iostream.h" (not recommended), add here a line that says:
using namespace std;

or


int main( int argc, char *argv[] )
{

switch this to:
           std::cout<<"Hello, world!"<<std::endl;

        cout << "Hello, World!\n";
        exit(0);
}

And compiling yields:

[EMAIL PROTECTED]:~/download/c++-check$ make 1
g++     1.cpp   -o 1
1.cpp: In function `int main(int, char**)':
1.cpp:5: error: `cout' undeclared (first use this function)
1.cpp:5: error: (Each undeclared identifier is reported only once for each
   function it appears in.)
make: *** [1] Error 1

HUH ?

Any input will be welcome, thanks,
Peter

PS: Other programs compile fine, but I am not sure how much 'other programs' span c++, since I did not pay too much attention to that.

         Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting ltd.
http://www.lingnu.com/


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to