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.
Forgot to CC: support-netcdf ... To: Keir Vaughan-Taylor <address@hidden> Fcc: +outbox Subject: Re: 941209: gmt and and a compile failure In-reply-to: Your message of "Fri, 09 Dec 1994 08:23:25 MST." Organization: UCAR Unidata Program -------- > Organization: ? > Keywords: 199412090123.AA19357 Hi Keir, > I'm trying to install gmt and it gived me and error (oh no) > > cc -c -traditional -O -I/local/netcdf/include -DLIBDIR=\"/local/gmt/lib\" > gmt_cdf.c > In file included from gmt_cdf.c:41: > /local/netcdf/include/netcdf.h:362: parse error before `char' > /local/netcdf/include/netcdf.h:366: parse error before `char' > /local/netcdf/include/netcdf.h:393: parse error before `const' > /local/netcdf/include/netcdf.h:398: parse error before `const' > > etc etc etc > > > necdf.h has the syntax error on const definitions such as..... > > extern int nccreate PROTO(( > const char* path, > int cmode > )); > > > I'm using the gcc compiler and there may be a flag problem >From what you sent, it looks like you're using cc rather than gcc. Did you rename gcc to be cc (that's what appears to be the case, since you're using a "-traditional" flag). > Got any ideas I'm not sure what version of netCDF comes with GMT, but the 232pl2 version we distribute from ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf.tar.Z has a `configure' script that you are supposed to run before using make to compile and install the netCDF library. The `configure' script is supposed to derive the compiler flags needed and construct Makefiles that use them. To do this, it requires that you tell it what compiler to use (if not "cc") with the CC environment variable or macro in the CUSTOMIZE file, or as an argument to the `configure' command. For example CC='gcc -traditional' or CC='cc -traditional' are possibilities, if you want to try to build with gcc (or gcc renamed to cc). On our platform (SunOS 5.3 using gcc 2.5.4) CC=gcc works fine. I just tested this and all the tests completed successfully with: % make distclean % ./configure CC=gcc % make all test -- Russ Rew UCAR Unidata Program address@hidden P.O. Box 3000 http://www.unidata.ucar.edu/ Boulder, CO 80307-3000