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.
>To: address@hidden >From: Greg Asner <address@hidden> >Subject: trouble linking >Organization: CIRES/Center for the Study of Earth from Space >Keywords: 199704181745.LAA15414 Hi Greg, > We built NetCDF on a Sun with OS5.5, and the netcdf.h and libnetcdf.a > files are in the directory with the source code for our model. > Everything seems to be working fine until it tries to link, and then we > receive the error message below. Can you tell me what I might be missing? > > Thanks, Greg Asner > > Undefined first referenced > symbol in file > xdr_enum libnetcdf.a(var.o) > xdr_float libnetcdf.a(cdf.o) > xdr_int libnetcdf.a(cdf.o) > xdr_vector libnetcdf.a(sharray.o) > xdr_u_long libnetcdf.a(cdf.o) > xdr_double libnetcdf.a(cdf.o) > xdr_long libnetcdf.a(dim.o) > xdr_opaque libnetcdf.a(cdf.o) Yes, on SunOS 5 you need to add "-lnsl" to the end of the link line, since that's where the Sun's XDR package resides. With netcdf-3, to be announced soon, you won't need that because we no longer use vendor-supplied XDR libraries. --Russ _____________________________________________________________________ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu