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.
Greetings Tong, > Hi , how are you? > We are doing well here in Boulder - getting ready for the next round of snow! Woohoo! > My name is Tong Wei from Harris Corp. > > We are using netcdf-4.0.1 in our codes. when I was trying to compile this > code, I got this error: > > ld: cannot find -lnetcdf_c++ > make: *** [lib/libLightningAlgorithm.so] Error 1 > > Here is its make file: > > NETCDF_LOCATION := /apps/netcdf-4.0.1 > $(CSU)_CPPFLAGS += -I$(NETCDF_LOCATION)/include > $(CSU)_LDFLAGS += -L$(NETCDF_LOCATION)/lib -Wl,-rpath=$(NETCDF_LOCATION)/lib > $(CSU)_LDLIBS += -lnetcdf_c++ > > Then I checked /apps/netcdf-4.0.1, and could not find lnetcdf_c++. Would > you please give us some hints on this ? Ok, if you can't find libnetcdf_c++.so within the netcdf lib directory, then we have a few problems. In this situation, nc-config is your friend. First, let's make sure you are looking in the right place for netCDF: nc-config --prefix Now that we know where netCDF lives (or at least the one your account it able to see), let's see if it has c++ enabled: nc-config --has-c++ Also, you will need to add -lnetcdf after -lnetcdf_c++ to your $(CSU)_LDLIBS flags in order to properly link to the netCDF library. Let me know what you find with nc-config :-) Cheers, Sean > > thanks. > > Tong Wei > GOES-R > 240 206 7095 > > > > > Ticket Details =================== Ticket ID: FWY-763930 Department: Support netCDF Priority: Normal Status: Open