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 Jatin! The extra 'f' in the -netcdff refers to the fortran library, whereas -lnetcdf is the c library. Check out http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-f90/Compiling-and-Linking-with-the-NetCDF-Library.html and http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-fortran-install.html for some more details as to why the two exist (short answer - they are shared libraries). The netCDF tool nc-config will tell you what you need to use when linking to the libraries: For C code: nc-config --libs and for FORTRAN code: nc-config --flibs Cheers! Sean > Hi, > General question: > What is the difference between using "-lnetcdf" and "-lnetcdff" when > compiling fortran programs which use netcdf libs? > I find on some machines, you only need "-lnetcdf", on other ones you need to > add "-lnetcdff", otherwise you get lots of "undefined references" to the > netcdf functions. > Just wondering out of interest. > Cheers, > Jatin. > > > --- > Dr. Jatin Kala > Research Associate > Centre of Excellence for Climate Systems Science > http://www.climatescience.org.au/ > University of New South Wales > Sydney, NSW, 2052, Australia > Email: address@hidden or address@hidden > Phone: +61 2 9385 9393 > > > > Ticket Details =================== Ticket ID: LTO-228407 Department: Support netCDF Priority: Normal Status: Open