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.
Hi Chanh, > I am a beginner of NETCDF format. Currently, I am trying to use NETCDF > format to archive my data, but somehow I could not compile the fortran > code. No matter how much I tried, I always get the error: > ld: > Can't locate file for: > -l/data/storm8/kieucq/netcdf/netcdf-3.5.1/lib/libnetcdf > > I checked the lib dir and do see file libnetcdf.a there. I am very > grateful if you help me out. I think what you really want to use on your compile line is the two flags "-L" (to specify the directory) and "-l" to specify the library, as in: f77 foo.f -L /data/storm8/kieucq/netcdf/netcdf-3.5.1/lib -lnetcdf -o foo Or you could use the library without either "-L" or "-l", as in: f77 foo.f /data/storm8/kieucq/netcdf/netcdf-3.5.1/lib/libnetcdf.a -o foo --Russ