PDA

View Full Version : g++ and deprecated iostream???



A. Jorge Garcia
06-10-2005, 03:49 AM
OK, I used to use and teach g++ a lot. In the last 2 years or so, I've switched to java. So, I guess I'm out of the loop when is comes to any g++ standards changes now a days. KNOPPIX has GNU GCC which includes g++ and using this I can write/compile/execute a standard helloworld.cc like:


//helloworld.cc MrG 2005.0609
//compile: g++ -o helloworld helloworld.cc
#include <iostream>
#include <string>
using namespace std;
int main()
{
string n;
cout << "What's your name? ";
cin >> n;
cout << "Hi, " << n << ", how about a nice game of chess?" << endl;
return 0;
}

However, on some distros lately I find that neither this program, nor anything else based on iostream, will compile correctly! Case in point, BCCD. Now, the author of that distro says that iostream and a number of other classes are depreicated but he still included all the *.h files in /include/c++/backward. So, I tried g++ -o helloworld helloword.cc -I/include/c++/backward to no avail. I also tried #include "/include/c++/backward/iostream.h" wothout any joy.

Anyone out there familiar with this problem know how to get around it?

TIA,
AJG