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

g++-3.0 problem (with include files?)



I have problems with g++3.0 in sid, both 3.0.3 and 3.0.4prexxx screws up
when trying to compile
a small test program,

#include <cstdlib>
#include <string>
#include <iostream>
int
main(int argc, char** argv )
{

  string muu = "Muuuu";

  cout << muu << endl;

  return 0;
}

with standard g++ it works fine:

beo204:~/tmp$ g++ -o main main.cpp 
beo204:~/tmp$ ./main 
Muuuu

But with g++3.0 it reports some errors. If I run with -v it displays all
the paths compiled in, which do seem ok. Why doesn't it find the correct
location of the include files (which I believe is the problem)?

beo204:~/tmp$ g++-3.0 -o main main.cpp 
main.cpp: In function `int main(int, char**)':
main.cpp:13: `string' undeclared (first use this function)
main.cpp:13: (Each undeclared identifier is reported only once for each 
   function it appears in.)
main.cpp:13: parse error before `=' token
main.cpp:15: `cout' undeclared (first use this function)
main.cpp:15: `muu' undeclared (first use this function)
main.cpp:15: `endl' undeclared (first use this function)

/Anders



Reply to: