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.
> Hi, > > I am trying to include netdcf in a model, written in c++ on a Mac (OS 10.5) > > The following code in my main.cpp: > > NcFile Nc(&NcFilename[0], NcFile::Replace, NULL, 0, NcFile::Classic); > > gives linker errors: > "NcFile::NcFile(char const*, NcFile::FileMode, unsigned long*, > unsigned long, NcFile::FileFormat)", referenced from: > _main in main.o > ld: symbol(s) not found > > When I installed netcdf 4.1.1 from source all configuration, > installation and testing went smootly > the includes are put in /opt/local/include, netcdfcpp.h is included in > main.cpp by #include <netcdfcpp.h> > I'm using Xcode as a programming interface > > Can anyone give me a clue how to solve this? > > Best regards > Ko van Huissteden > > Howdy Ko! I suggest you use the C API instead of the C++ API. The C++ API is outdated, and we are working on a replacement, but it is not ready yet. However, if you still want to use it, go into the cxx directory in the netCDF install, and run "make check" to run the C++ API tests. Thanks, Ed Ticket Details =================== Ticket ID: RKJ-114360 Department: Support netCDF Priority: Normal Status: Closed