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]

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



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