This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
string class and iostream
- From: "Lele Rizzo" <lele-rizzo at libero dot it>
- To: "gcc-help" <gcc-help at gcc dot gnu dot org>
- Date: Thu, 7 Nov 2002 15:53:13 +0100
- Subject: string class and iostream
Hello to all, someone may help me pls?!
i've just installed RedHat 8 (with gcc 3.2.7),i tryed to compile the
following file:
------ file beginning -------
#include <iostream>
#include <string>
int main()
{
string aa="Hello\n";
cout << aa;
return 1;
}
------- file end ---------
But i get the following error message:
[sliverd@casa cpp]$ g++ bb.cpp -o bb
bb.cpp: In function `int main()':
bb.cpp:5: `string' undeclared (first use this function)
bb.cpp:5: (Each undeclared identifier is reported only once for each
function
it appears in.)
bb.cpp:5: parse error before `=' token
bb.cpp:6: `cout' undeclared (first use this function)
bb.cpp:6: `aa' undeclared (first use this function)
[sliverd@casa cpp]$
i tryed to include even other library (like string, string.h,
stdio.h...etc..),
but it never compile!
Thanks
Lele Rizzo