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: Russ Rew <address@hidden> >From: "Robert Shectman" <address@hidden> >Subject: Re: 970123: C++ interface to NetCDF >Organization: Lawrence Livermore National Laboratory >Keywords: 199701232308.QAA11227 Hi Robert, > On Jan 24, 7:43am, Russ Rew wrote: > > Subject: Re: 970123: C++ interface to NetCDF > > Please let us know if you discover any problems with it. Thanks. > > > > Well since you mention it, > > src/cxx/ncvalues.cc - line 156: > > as_string_implement(short) > as_string_implement(nclong) > as_string_implement(float) > as_string_implement(double) > > > src/cxx/ncvalues.h - line 197: > > #define as_string_implement(TYPE) \ > char* NcVal(TYPE)::as_string( long n ) const \ > { \ > char* s = new char[32]; \ > ostrstream(s, sizeof(s)) << the_values[n] << ends ; \ > return s; \ > } > > > On Digital Unix on the alpha: > > >uname -a > OSF1 frosty.llnl.gov V4.0 464 alpha > >cxx -V > DEC C++ V5.4-006 on Digital UNIX (Alpha) > > > The compiler claims that there is no appropriate operator << for ostream > > cxx: Error: ../ncvalues.cc, line 157: In this statement, the argument list > "ostrstream(s,sizeof(s))<<the_values[n]" matches no "ostream::operator <<". > as_string_implement(short) > ^ > cxx: Error: ../ncvalues.cc, line 158: In this statement, the argument list > "ostrstream(s,sizeof(s))<<the_values[n]" matches no "ostream::operator <<". > as_string_implement(nclong) > ^ > cxx: Error: ../ncvalues.cc, line 159: In this statement, the argument list > "ostrstream(s,sizeof(s))<<the_values[n]" matches no "ostream::operator <<". > as_string_implement(float) > ^ > cxx: Error: ../ncvalues.cc, line 160: In this statement, the argument list > "ostrstream(s,sizeof(s))<<the_values[n]" matches no "ostream::operator <<". > as_string_implement(double) > ^ > > > However the code does compile on sgi's and solaris. I haven't had much > time to investigate why this is happening at this point. We have been using g++ on our DEC Alpha, because we don't have a license for cxx. The above messages look like a compiler error to me. This code compiles on all the other C++ platforms to which we have access. Thanks for reporting this. --Russ _____________________________________________________________________ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu