This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
>To: address@hidden >From: Greg Ruetsch <ruetsch*@leland.Stanford.EDU> >Subject: C++ interface problems on SGI IRIX >Organization: . >Keywords: 200002182304.QAA17688 Hi Greg, > > I've been having some trouble getting the C++ interface to work on > various SGI machines (Octane, O2K). I've cut down the problem to > the following which won't compile unless the "#include netcdfcpp.h" > line is removed: > #include <iostream> > #include "netcdfcpp.h" > using namespace std; > int main() { > cerr << "This has gotta work" << endl; > return 0; > } > As is, compilation results in: > turing.ruetsch 155> ./make > CC -LANG:std -I. -L. really_simple.cc -lnetcdf_c++ -lnetcdf -o > really_simple > cc-1239 CC: ERROR File = really_simple.cc, Line = 6 > "cerr" is ambiguous. > cerr << "This has gotta work" << endl; > ^ > 1 error detected in the compilation of "really_simple.cc". > make: *** [really_simple] Error 2 > Is there a new version of netcdfcpp.h (or netcdf.h or ncvalues.h) > that fixed this. I've tried several releases of the SGI CC compiler, > and the error occurs on all that have iostream (7.3.0.0 and later). Thanks for taking the trouble to isolate the problem to this simple example. We don't have any newer version of any of those files than is in netcdf-3.5-beta2, which I assume is the version you are using. I just tested this version on an irix_6.5-mips platform, with MIPSpro Compilers: Version 7.3.1.1m, on which the C++ interface seemed to build and work fine (at least according to the simple test "make test" does), but I can duplicate the problem you see with really_simple.cc. I'll have to look at this more carefully next week (Monday is a holiday) ... --Russ _____________________________________________________________________ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu