Hello Nishant, I'll need a little more information; what version of the netCDF C++ interface are you using, and what version of the underlying netCDF-C library was it built against? Also, how are you trying to compile this program you included? It looks like perhaps you are not linking it properly against the C++ interface. -Ward > Full Name: Nishant Sharma > Email Address: address@hidden > Organization: San Jose State University > Package Version: > Operating System: > Hardware: > Description of problem: Hi, > I'm getting following error. Please let me know if you need any other details. > > Code > > #include <iostream> > #include <iomanip> > #include <netcdf> > > using namespace std; > using namespace netCDF; > using namespace netCDF::exceptions; > > > int main() > { > > NcFile > dataFile("/home/nishant/Documents/SJSU/CMPE275/Project/test/20140101_0000.gz",NcFile::read); > cout<<"there are "<<dataFile.getVarCount()<<" variables"<<endl; > > > } > > > > readfile.o: In function `main': > readfile.cpp:(.text+0x5a): undefined reference to > `netCDF::NcFile::NcFile(std::string const&, netCDF::NcFile::FileMode)' > readfile.cpp:(.text+0x83): undefined reference to > `netCDF::NcGroup::getVarCount(netCDF::NcGroup::Location) const' > readfile.cpp:(.text+0xc4): undefined reference to `netCDF::NcFile::~NcFile()' > readfile.cpp:(.text+0xeb): undefined reference to `netCDF::NcFile::~NcFile()' > readfile.cpp:(.text+0x116): undefined reference to `netCDF::NcFile::~NcFile()' > collect2: error: ld returned 1 exit status > > > Ticket Details =================== Ticket ID: XBB-605615 Department: Support netCDF Priority: Normal Status: Closed
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.