Compiling old source with pgcc

Hi,

somebody gave me old code to port it onto our HPC cluster.

The was developed under g++ 2.8 or earlier. Current g++ will stop at the
beginning. So I tried pgCC (8.0.1) and it work for a lot of files, but I get the following
messages:

/usr/local/apps/pgi/8.0.1/linux86-64/8.0/bin/pgCC -O3 -g -w -I/usr/include -c guessio.cpp
“guessio.cpp”, line 2211: error: identifier “cerr” is undefined
if (!eogrid) cerr << “eogrid file open failed!” << endl;
^


I’ve no expirence with c++ - so is there a switch to turn off this kind of check
so that undefined variables can be used ?


Thanks, Peer

I’ve no expirence with c++ - so is there a switch to turn off this kind of check
so that undefined variables can be used ?

C++ is strongly typed so you need to declare your variables before using them. In this case, to get ‘cerr’ defined you just need to include the iostream header file. Some where near the top of the file add "#include ".

Hope this helps,
Mat