netCDF-c version 4.9.3
OS -- macos and linux were only ones tested
When I build netCDF-c as a static only library, the generated dependent libraries in nc-config and libnetcdf.settings list the hdf5-related libraries in the wrong order and result in missing symbols in the link.
Here is the nc-config --static output:
-L/Users/me/src/project-static/lib -lnetcdf -lHDF5::HDF5 -lhdf5::hdf5_hl -lm -lz -ldl -lzstd -lbz2 -lxml2
And here is the corresponding line in the libnetcdf.settings
Shared Library: no
Static Library: yes
Extra libraries: -lHDF5::HDF5 -lhdf5::hdf5_hl -lm -lz -ldl -lzstd -lbz2 -lxml2
The hdf5_hl library needs to come before the hdf5 library in order to resolve all symbols.
This also happens in the netCDFTargets.cmake CMake configuration file.
netCDF-c version 4.9.3
OS -- macos and linux were only ones tested
When I build netCDF-c as a static only library, the generated dependent libraries in
nc-configandlibnetcdf.settingslist the hdf5-related libraries in the wrong order and result in missing symbols in the link.Here is the
nc-config --staticoutput:And here is the corresponding line in the
libnetcdf.settingsThe
hdf5_hllibrary needs to come before thehdf5library in order to resolve all symbols.This also happens in the
netCDFTargets.cmakeCMake configuration file.