[gdal-dev] netcdf option build error

Jeshua Lacock jeshua at openosx.com
Tue Apr 29 10:15:21 EDT 2008


Greetings,

I am having difficulty building GDAL 1.5.1 on Mac OS X 10.5.2 with the  
netcdf format enabled. If I disable the netcdf option, GDAL builds  
without incident.

I have netcdf 3.6.2 installed and have specified the installation  
location with the --with-netcdf flag.

It seems like it is not parsing netcdf.h.  In GDALmake.opt  
NETCDF_SETTING is set to 'yes'.

Any pointers would be greatly appreciated.

Here are the error messages:

netcdfdataset.h:151: error: 'NC_MAX_NAME' was not declared in this scope
netcdfdataset.cpp: In member function 'CPLErr  
netCDFRasterBand::CreateBandMetadata()':
netcdfdataset.cpp:144: error: 'NC_MAX_NAME' was not declared in this  
scope
netcdfdataset.cpp:145: error: size of array 'szMetaName' has non- 
integral type '<type error>'
netcdfdataset.cpp:157: error: size of array 'szTemp' has non-integral  
type '<type error>'
netcdfdataset.cpp:167: error: 'szVarName' was not declared in this scope
netcdfdataset.cpp:167: error: 'nc_inq_varname' was not declared in  
this scope
netcdfdataset.cpp:168: error: 'nc_inq_varndims' was not declared in  
this scope
netcdfdataset.cpp:198: error: 'class netCDFDataset' has no member  
named 'papszDimName'
netcdfdataset.cpp:205: error: 'nc_inq_varid' was not declared in this  
scope
netcdfdataset.cpp:218: error: 'nc_inq_vartype' was not declared in  
this scope
netcdfdataset.cpp:231: error: 'nc_get_vara_short' was not declared in  
this scope
netcdfdataset.cpp:234: error: 'NC_INT' was not declared in this scope
netcdfdataset.cpp:238: error: 'nc_get_vara_int' was not declared in  
this scope
netcdfdataset.cpp:245: error: 'nc_get_vara_float' was not declared in  
this scope
netcdfdataset.cpp:252: error: 'nc_get_vara_double' was not declared in  
this scope
netcdfdataset.cpp: In constructor  
'netCDFRasterBand::netCDFRasterBand(netCDFDataset*, int, int, int,  
int*, int*, int)':
netcdfdataset.cpp:311: error: 'NC_NAT' was not declared in this scope
netcdfdataset.cpp:353: error: 'nc_inq_var' was not declared in this  
scope
netcdfdataset.cpp:363: error: 'NC_INT' was not declared in this scope
netcdfdataset.cpp:382: error: 'nc_inq_att' was not declared in this  
scope
netcdfdataset.cpp:400: error: 'nc_inq_vartype' was not declared in  
this scope
netcdfdataset.cpp:408: error: 'nc_get_att_text' was not declared in  
this scope
netcdfdataset.cpp:415: error: 'nc_get_att_short' was not declared in  
this scope
netcdfdataset.cpp:418: error: 'NC_INT' was not declared in this scope
netcdfdataset.cpp:421: error: 'nc_get_att_int' was not declared in  
this scope
netcdfdataset.cpp:427: error: 'nc_get_att_float' was not declared in  
this scope
netcdfdataset.cpp:432: error: 'nc_get_att_double' was not declared in  
this scope
netcdfdataset.cpp:438: error: 'nc_get_att_double' was not declared in  
this scope
netcdfdataset.cpp:447: error: 'NC_FILL_CHAR' was not declared in this  
scope
netcdfdataset.cpp:450: error: 'NC_FILL_SHORT' was not declared in this  
scope
netcdfdataset.cpp:452: error: 'NC_INT' was not declared in this scope
netcdfdataset.cpp:453: error: 'NC_FILL_INT' was not declared in this  
scope
netcdfdataset.cpp:456: error: 'NC_FILL_FLOAT' was not declared in this  
scope
netcdfdataset.cpp:459: error: 'NC_FILL_DOUBLE' was not declared in  
this scope
netcdfdataset.cpp: In member function 'virtual CPLErr  
netCDFRasterBand::IReadBlock(int, int, void*)':
netcdfdataset.cpp:492: error: 'nc_inq_varndims' was not declared in  
this scope
netcdfdataset.cpp:538: error: 'nc_get_vara_uchar' was not declared in  
this scope
netcdfdataset.cpp:541: error: 'nc_get_vara_short' was not declared in  
this scope
netcdfdataset.cpp:546: error: 'nc_get_vara_long' was not declared in  
this scope
netcdfdataset.cpp:549: error: 'nc_get_vara_int' was not declared in  
this scope
netcdfdataset.cpp:553: error: 'nc_get_vara_float' was not declared in  
this scope
netcdfdataset.cpp:561: error: 'nc_get_vara_double' was not declared in  
this scope
netcdfdataset.cpp:573: error: 'nc_strerror' was not declared in this  
scope
netcdfdataset.cpp: In destructor 'virtual  
netCDFDataset::~netCDFDataset()':
netcdfdataset.cpp:621: error: 'nc_close' was not declared in this scope
netcdfdataset.cpp: In member function 'void  
netCDFDataset::SetProjection(int)':
netcdfdataset.cpp:714: error: 'nc_inq_varname' was not declared in  
this scope
netcdfdataset.cpp:727: error: 'class netCDFDataset' has no member  
named 'papszDimName'
netcdfdataset.cpp:729: error: 'class netCDFDataset' has no member  
named 'papszDimName'
netcdfdataset.cpp:738: error: 'nc_inq_varid' was not declared in this  
scope
netcdfdataset.cpp:831: error: 'class netCDFDataset' has no member  
named 'papszDimName'
netcdfdataset.cpp:831: error: 'nc_inq_varid' was not declared in this  
scope
netcdfdataset.cpp:832: error: 'class netCDFDataset' has no member  
named 'papszDimName'
netcdfdataset.cpp:845: error: 'nc_get_vara_double' was not declared in  
this scope
netcdfdataset.cpp:915: error: 'nc_get_att_int' was not declared in  
this scope
netcdfdataset.cpp:917: error: 'nc_get_att_double' was not declared in  
this scope
netcdfdataset.cpp:927: error: 'nc_get_att_double' was not declared in  
this scope
netcdfdataset.cpp: In member function 'CPLErr  
netCDFDataset::ReadAttributes(int, int)':
netcdfdataset.cpp:1131: error: 'NC_MAX_NAME' was not declared in this  
scope
netcdfdataset.cpp:1132: error: size of array 'szVarName' has non- 
integral type '<type error>'
netcdfdataset.cpp:1141: error: 'nc_inq_varnatts' was not declared in  
this scope
netcdfdataset.cpp:1146: error: 'nc_inq_varname' was not declared in  
this scope
netcdfdataset.cpp:1151: error: 'szAttrName' was not declared in this  
scope
netcdfdataset.cpp:1151: error: 'nc_inq_attname' was not declared in  
this scope
netcdfdataset.cpp:1152: error: 'szMetaName' was not declared in this  
scope
netcdfdataset.cpp:1153: error: 'nc_inq_att' was not declared in this  
scope
netcdfdataset.cpp:1162: error: 'nc_get_att_text' was not declared in  
this scope
netcdfdataset.cpp:1168: error: 'nc_get_att_short' was not declared in  
this scope
netcdfdataset.cpp:1177: error: 'NC_INT' was not declared in this scope
netcdfdataset.cpp:1180: error: 'nc_get_att_int' was not declared in  
this scope
netcdfdataset.cpp:1192: error: 'nc_get_att_float' was not declared in  
this scope
netcdfdataset.cpp:1204: error: 'nc_get_att_double' was not declared in  
this scope
netcdfdataset.cpp: In member function 'void  
netCDFDataset::CreateSubDatasetList()':
netcdfdataset.cpp:1255: error: 'nc_inq_nvars' was not declared in this  
scope
netcdfdataset.cpp:1258: error: 'nc_inq_varndims' was not declared in  
this scope
netcdfdataset.cpp:1261: error: 'nc_inq_vardimid' was not declared in  
this scope
netcdfdataset.cpp:1268: error: 'nc_inq_dimlen' was not declared in  
this scope
netcdfdataset.cpp:1274: error: 'nc_inq_vartype' was not declared in  
this scope
netcdfdataset.cpp:1287: error: 'NC_INT' was not declared in this scope
netcdfdataset.cpp:1299: error: 'nc_inq_varname' was not declared in  
this scope
netcdfdataset.cpp:1300: error: 'nc_inq_att' was not declared in this  
scope
netcdfdataset.cpp:1302: error: 'nc_get_att_text' was not declared in  
this scope
netcdfdataset.cpp: In static member function 'static GDALDataset*  
netCDFDataset::Open(GDALOpenInfo*)':
netcdfdataset.cpp:1348: error: 'NC_MAX_NAME' was not declared in this  
scope
netcdfdataset.cpp:1384: error: 'nc_open' was not declared in this scope
netcdfdataset.cpp:1391: error: 'nc_inq' was not declared in this scope
netcdfdataset.cpp:1402: error: 'nc_inq_varid' was not declared in this  
scope
netcdfdataset.cpp:1409: error: 'nc_close' was not declared in this scope
netcdfdataset.cpp:1414: error: 'nc_inq_ndims' was not declared in this  
scope
netcdfdataset.cpp:1420: error: 'nc_close' was not declared in this scope
netcdfdataset.cpp:1427: error: 'attname' was not declared in this scope
netcdfdataset.cpp:1427: error: 'nc_get_att_text' was not declared in  
this scope
netcdfdataset.cpp:1437: error: 'nc_inq_nvars' was not declared in this  
scope
netcdfdataset.cpp:1456: error: 'nc_inq_varndims' was not declared in  
this scope
netcdfdataset.cpp:1479: error: size of array 'pszNETCDFFilename' has  
non-integral type '<type error>'
netcdfdataset.cpp:1480: error: size of array 'szVarName' has non- 
integral type '<type error>'
netcdfdataset.cpp:1482: error: 'nc_inq_varname' was not declared in  
this scope
netcdfdataset.cpp:1504: error: 'nc_inq_varid' was not declared in this  
scope
netcdfdataset.cpp:1505: error: 'nc_inq_varndims' was not declared in  
this scope
netcdfdataset.cpp:1510: error: 'nc_inq_vardimid' was not declared in  
this scope
netcdfdataset.cpp:1535: error: 'nc_inq_dimlen' was not declared in  
this scope
netcdfdataset.cpp:1575: error: 'class netCDFDataset' has no member  
named 'papszDimName'
netcdfdataset.cpp:1575: error: 'nc_inq_dimname' was not declared in  
this scope
netcdfdataset.cpp:1576: error: 'class netCDFDataset' has no member  
named 'papszDimName'
netcdfdataset.cpp: In function 'void CopyMetadata(void*, int, int)':
netcdfdataset.cpp:1667: error: 'nc_put_att_text' was not declared in  
this scope
netcdfdataset.cpp:1697: error: 'nc_put_att_text' was not declared in  
this scope
netcdfdataset.cpp: In function 'GDALDataset* NCDFCreateCopy(const  
char*, GDALDataset*, int, char**, int (*)(double, const char*, void*),  
void*)':
netcdfdataset.cpp:1721: error: 'NC_MAX_DIMS' was not declared in this  
scope
netcdfdataset.cpp:1722: error: size of array 'anBandMap' has non- 
integral type '<type error>'
netcdfdataset.cpp:1725: error: 'NC_MAX_NAME' was not declared in this  
scope
netcdfdataset.cpp:1742: error: 'nc_create' was not declared in this  
scope
netcdfdataset.cpp:1754: error: 'nc_def_dim' was not declared in this  
scope
netcdfdataset.cpp:1807: error: 'pszNetcdfProjection' was not declared  
in this scope
netcdfdataset.cpp:1812: error: 'nc_def_var' was not declared in this  
scope
netcdfdataset.cpp:1824: error: 'nc_put_att_double' was not declared in  
this scope
netcdfdataset.cpp:1849: error: 'nc_put_att_text' was not declared in  
this scope
netcdfdataset.cpp:1904: error: 'pszNetcdfProjection' was not declared  
in this scope
netcdfdataset.cpp:1913: error: 'nc_def_var' was not declared in this  
scope
netcdfdataset.cpp:1925: error: 'nc_put_att_double' was not declared in  
this scope
netcdfdataset.cpp:1950: error: 'nc_put_att_text' was not declared in  
this scope
netcdfdataset.cpp:1961: error: 'pszNetcdfProjection' was not declared  
in this scope
netcdfdataset.cpp:2000: error: 'nc_put_att_float' was not declared in  
this scope
netcdfdataset.cpp:2020: error: size of array 'szBandName' has non- 
integral type '<type error>'
netcdfdataset.cpp:2043: error: 'anBandDims' was not declared in this  
scope
netcdfdataset.cpp:2053: error: 'nc_def_var' was not declared in this  
scope
netcdfdataset.cpp:2081: error: 'nc_put_att_uchar' was not declared in  
this scope
netcdfdataset.cpp:2094: error: 'nc_enddef' was not declared in this  
scope
netcdfdataset.cpp:2096: error: 'nc_put_vara_uchar' was not declared in  
this scope
netcdfdataset.cpp:2102: error: 'nc_redef' was not declared in this scope
netcdfdataset.cpp:2113: error: 'nc_def_var' was not declared in this  
scope
netcdfdataset.cpp:2126: error: 'nc_put_att_short' was not declared in  
this scope
netcdfdataset.cpp:2139: error: 'nc_enddef' was not declared in this  
scope
netcdfdataset.cpp:2141: error: 'nc_put_vara_short' was not declared in  
this scope
netcdfdataset.cpp:2142: error: 'nc_redef' was not declared in this scope
netcdfdataset.cpp:2151: error: 'NC_INT' was not declared in this scope
netcdfdataset.cpp:2152: error: 'nc_def_var' was not declared in this  
scope
netcdfdataset.cpp:2166: error: 'nc_put_att_int' was not declared in  
this scope
netcdfdataset.cpp:2181: error: 'nc_enddef' was not declared in this  
scope
netcdfdataset.cpp:2183: error: 'nc_put_vara_int' was not declared in  
this scope
netcdfdataset.cpp:2184: error: 'nc_redef' was not declared in this scope
netcdfdataset.cpp:2193: error: 'nc_def_var' was not declared in this  
scope
netcdfdataset.cpp:2207: error: 'nc_put_att_float' was not declared in  
this scope
netcdfdataset.cpp:2222: error: 'nc_enddef' was not declared in this  
scope
netcdfdataset.cpp:2224: error: 'nc_put_vara_float' was not declared in  
this scope
netcdfdataset.cpp:2225: error: 'nc_redef' was not declared in this scope
netcdfdataset.cpp:2234: error: 'nc_def_var' was not declared in this  
scope
netcdfdataset.cpp:2247: error: 'nc_put_att_double' was not declared in  
this scope
netcdfdataset.cpp:2262: error: 'nc_enddef' was not declared in this  
scope
netcdfdataset.cpp:2264: error: 'nc_put_vara_double' was not declared  
in this scope
netcdfdataset.cpp:2265: error: 'nc_redef' was not declared in this scope
netcdfdataset.cpp:2281: error: 'pszNetcdfProjection' was not declared  
in this scope
netcdfdataset.cpp:2282: error: 'nc_put_att_text' was not declared in  
this scope
netcdfdataset.cpp:2291: error: 'nc_put_att_text' was not declared in  
this scope
netcdfdataset.cpp:2309: error: 'nc_close' was not declared in this scope
make[3]: *** [../o/netcdfdataset.o] Error 1
make[2]: *** [netcdf-install-obj] Error 2
make[1]: *** [frmts-target] Error 2
make: *** [gdal] Error 2



Thank you,

Jeshua Lacock, Owner
<http://OpenOSX.com>
phone: 877.240.1364



More information about the gdal-dev mailing list