Here is my simple code. The problem occured in a much more difficult program, but this is the simplest example that I could generate.
I am using the gnu g++ compiler under linux Mandrake 7.2. I used the following command to compile: g++ test.cppCode:// test.cpp #include<iostream> main() { cout << "test\n"; }
The following error occured:
test.cpp: In function `int main()':
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.)
My first thought was that the header file was not within my path, but it was indeed there. I switched over to the <iostream.h> but I got a compiler warning about out of date header files that I was able to counteract by using the appropriate switch. This solution, does not lend itself to using the STL headers. Since I end up with a similar error for the STL functions and type definitions. Is there a compiler switch that needs to be used to use the up-to-date header files?