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: Daniel Amorese <address@hidden> >Subject: installation problem >Organization: . >Keywords: 199903240801.BAA04331 Hi Daniel, Steve Emmerson forwarded your reply to me to handle. > I have adopted the following settings: > CC /usr/local/bin/gcc > CXX /usr/local/bin/g++ > > Compilation in cxx failed again : > Making `all' in directory /usr/local/GMT/netcdf-3.4/src/cxx > > /usr/local/bin/g++ -c -O -I../libsrc -DNDEBUG netcdf.cc > /usr/local/lib/g++-include/streambuf.h: In method `void ios::init(struct > streambuf *, class ostream *)': > In file included from /usr/local/lib/g++-include/iostream.h:31, > from ncvalues.hh:13, > from netcdf.hh:16, > from netcdf.cc:12: > /usr/local/lib/g++-include/streambuf.h:448: warning: `void ios::init(struct > streambuf *, class ostream *)' was used before it was declared inline > /usr/local/lib/g++-include/streambuf.h:252: warning: previous non-inline > declaration here > /usr/local/bin/g++ -c -O -I../libsrc -DNDEBUG ncvalues.cc > /usr/local/lib/g++-include/streambuf.h: In method `void ios::init(struct > streambuf *, class ostream *)': > In file included from /usr/local/lib/g++-include/iostream.h:31, > from ncvalues.cc:10: > /usr/local/lib/g++-include/streambuf.h:448: warning: `void ios::init(struct > streambuf *, class ostream *)' was used before it was declared inline > /usr/local/lib/g++-include/streambuf.h:252: warning: previous non-inline > declaration here > : libnetcdf_c++.a > /usr/local/bin/g++ -c -O -I../libsrc -DNDEBUG nctst.cc > /usr/local/lib/g++-include/streambuf.h: In method `void ios::init(struct > streambuf *, class ostream *)': > In file included from /usr/local/lib/g++-include/iostream.h:31, > from nctst.cc:1: > /usr/local/lib/g++-include/streambuf.h:448: warning: `void ios::init(struct > streambuf *, class ostream *)' was used before it was declared inline > /usr/local/lib/g++-include/streambuf.h:252: warning: previous non-inline > declaration here > /usr/local/bin/g++ -o nctst -I../libsrc -DNDEBUG -O nctst.o libnetcdf_c++.a > -L../libsrc -lnetcdf > ld: fatal: library -lstdc++: not found > ld: fatal: File processing errors. No output written to nctst > *** Error code 1 > make: Fatal error: Command failed for target `nctst' > Current working directory /usr/local/GMT/netcdf-3.4/src/cxx > *** Error code 1 > make: Fatal error: Command failed for target `subdir_target' > Current working directory /usr/local/GMT/netcdf-3.4/src > make: Fatal error: Command failed for target `cxx/all' > > Thank you for your help. > > Daniel Amorese > P.S. : perhaps the problem is with my c++ compiler ? (but a > libstdc++.so.2.7.0 file exists > in /usr/local/lib....if the problem goes on I should re-install and update my > compilers...) I can't duplicate the problem here, because we don't have that version of g++ on a Solaris 2.4 platform, but I did try building netCDF 3.4 using g++ version 2.8.1 and gcc 2.8.1 on a Solaris 2.6 platform, and everything seemed to work fine, with no warnings or errors: ... Making `all' in directory /scratch/russ/builds/sunos_5.6-sparc-3.4/src/cxx g++ -c -O -I../libsrc -DNDEBUG netcdf.cc g++ -c -O -I../libsrc -DNDEBUG ncvalues.cc ar cru libnetcdf_c++.a netcdf.o ncvalues.o ranlib libnetcdf_c++.a g++ -c -O -I../libsrc -DNDEBUG nctst.cc g++ -o nctst -I../libsrc -DNDEBUG -O nctst.o libnetcdf_c++.a -L../libsrc -lnetcdf ... Making `test' in directory /scratch/russ/builds/sunos_5.6-sparc-3.4/src/cxx ar cru libnetcdf_c++.a netcdf.o ncvalues.o ranlib libnetcdf_c++.a ./nctst > test.out *** C++ test successful *** The error you got > ld: fatal: library -lstdc++: not found would seem to indicate that your g++ compiler is not looking in the right place for libstdc++.so.2.7.0. You might want to reinstall or upgrade your g++/gcc compilers. Alternatively, if you aren't planning to use the C++ interface, you could just specify CXX="" before running the configure script (after removing the config.cache file and running "make clean"). This would build the C and Fortran libraries and utilities, which are all that are needed for many uses of netCDF. --Russ _____________________________________________________________________ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu