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.
> Organization: Dept. of Oceanography, Dalhousie University > Keywords: 199502071946.AA10756 On Tue, 7 Feb 1995, Russ Rew wrote: > > Organization: Dept. of Oceanography, Dalhousie University > > Keywords: 199502071946.AA10756 > > I think this may just be the order of arguments to gcc. Try the following > instead: > > gcc -ansi -o tbl2cdf -I/opt/netcdf/include tbl2cdf.c -L/opt/netcdf/lib > -lnetcdf > > If that doesn't work, I'm stumped. It works! I'm amazed that gcc is so sensitive to argument placement. Although, it does make sense that the final arguments are just passed to the linker. Also, in testing nctst.cc, I found this exact ordering was needed: g++ -o nctst -I/opt/netcdf/include nctst.cc -L/opt/netcdf/lib -lnetcdf_c++ -lnetcdf Even if the order of the final two arguments is reversed it won't link! Thanks (again) for your help! ________________________________________________________________________ Steven Matheson E-mail: address@hidden Dept. of Oceanography Phone: (902) 494-6663 Dalhousie University FAX: (902) 494-2885 Halifax, NS CANADA, B3H 4J1 http://www.phys.ocean.dal.ca/~matheson/