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.
Ekow, > To: address@hidden > From: Ekow Otoo <address@hidden> > Subject: Re: Encountering Installation Failures for netCDF > Organization: LBNL The above message contained the following: > Hi Support, > It appears there is some missing information "class-key" in a > declaration. > The relevant information logged are included in the rest of the mail > Ekow ... > Making `all' in directory > /home/ekowo2/user1/spc1/gnuTmp/netcdf-3.5.0/src/cxx > > gmake[2]: Entering directory > `/home/ekowo2/user1/spc1/gnuTmp/netcdf-3.5.0/src/cxx' > g++ -c -I../libsrc -I. -Df2cFortran netcdf.cpp > In file included from > /usr/local2/include/c++/3.2/backward/iostream.h:31, > from ncvalues.h:13, > from netcdfcpp.h:16, > from netcdf.cpp:12: > /usr/local2/include/c++/3.2/backward/backward_warning.h:32:2: warning: > #warning This file includes at least one deprecated or antiquated > header. Please consider using one of the 32 headers found in section > 17.4.1.2 of the C++ standard. Examples include substituting the <X> > header for the <X.h> header for C++ includes, or <sstream> instead of > the deprecated header <strstream.h>. To disable this warning use > -Wno-deprecated. > In file included from netcdf.cpp:12: > netcdfcpp.h:157: friend declaration requires class-key, i.e. `friend > class > NcFile' > netcdfcpp.h:360: friend declaration requires class-key, i.e. `friend > class > NcFile' > netcdfcpp.h:391: friend declaration requires class-key, i.e. `friend > class > NcFile' > gmake[2]: *** [netcdf.o] Error 1 > gmake[2]: Leaving directory > `/home/ekowo2/user1/spc1/gnuTmp/netcdf-3.5.0/src/cxx' > gmake[1]: *** [subdir_target] Error 1 > gmake[1]: Leaving directory > `/home/ekowo2/user1/spc1/gnuTmp/netcdf-3.5.0/src' > gmake: *** [cxx/all] Error 2 This is a known bug and is fixed in the latest "beta" release. The solution can also be found in a previous support-email at http://www.unidata.ucar.edu/cgi-bin/mfs/70/4643?43#mfs Here's the relevant excerpt: OK, this is a known bug that is fixed in the netcdf-3.5.1 beta distribution. You can make the changes to the 3.5 file yourself by editing netcdfcpp.h and changing the lines that are causing the problems. The fix is exactly as the make log lines indicate: replace the friend declaration with 'friend class'. For example: at line 157, change: friend NcFile; to: friend class NcFile; Don't forget to do the same thing for lines 360 and 391 in netcdfcpp.h. After doing this, you should be able to continue your make. Don't hesitate to contact me if you have additional questions. Regards, Steve Emmerson <http://www.unidata.ucar.edu>