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.
Hello James, There is nothing inherently incorrect or broken when building libnetcdf statically; you should be able to link against it. I will try to provide as much help as I can to get your code to link to netcdf. I'll need some additional information: 1. What platform/compiler are you using? 2. What version of netcdf are you using? 3. If you are using netcdf4 and/or dap, what version(s) of hdf5 and libcurl are you using? 4. How are you trying to compile your program, and what is the error and/or message you receive? Is it possible to get a copy of the code you are trying to compile which links against netcdf? This won't be necessary, but it would make duplicating the issue and sending you an exact solution much easier. Have a great day, -Ward > Hi, > > I’d like to build a copy of libnetcdf that can be statically linked. When I > try (using —disable-shared to configure) I find my code will not link with > the resulting library. I’ve tried forcing the compile to use -fPIC, without > success. Any tips? Is this something that you support? > > James > -- > James Gallagher > jgallagher at opendap.org > 406.723.8663 > > > Ticket Details =================== Ticket ID: TQM-470039 Department: Support netCDF Priority: Normal Status: Closed