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.
Aaron, >Date: Fri, 16 Aug 1996 14:48:59 -0600 >From: address@hidden (Aaron Lai) >Organization: Las Alamos National Laboratory >To: address@hidden >Subject: netCDF xdr_ link >Keywords: 199608162049.AA25923 In the above message you wrote: > I got a program from NCAR/CGD called 'gennet.for'. They told me that > after I compile it and link with netCDF library I will be able to excute > it with input of the netCDF filename and get a FORTRAN program to read > the netCDF file. > > I tried to compile and link with the netCDF library installed by the > system manager of my local SUN network. It gave me an error message: > > gennet.f: > MAIN: > Undefined first referenced > symbol in file > xdr_enum ../lib/libnetcdf.a(array.o) > xdr_float ../lib/libnetcdf.a(cdf.o) > xdr_int ../lib/libnetcdf.a(array.o) > xdr_vector ../lib/libnetcdf.a(sharray.o) > xdr_u_long ../lib/libnetcdf.a(array.o) > xdr_double ../lib/libnetcdf.a(cdf.o) > xdr_long ../lib/libnetcdf.a(dim.o) > xdr_opaque ../lib/libnetcdf.a(array.o) > ld: fatal: Symbol referencing errors. No output written to a.out The utility that links together a netCDF-using program must be told to use the XDR library. On a Solaris system, the XDR library is contained in the network support library. Thus, a link-command should be something like the following: ld ... -L/usr/local//lib -lnetcdf ... -lnsl The `-lnsl' argument references the network support library. -------- Steve Emmerson <address@hidden>