[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #FBR-789563]: netCDF examples problem



Hi Mariana,

In order to use the C++ software, it's first necessary to get, build, and 
install
the netCDF C software on which it depends.  Once that is installed, it's 
possible
to build install and use the separate netCDF C++ library.

Instructions for getting and building the netCDF C software are here:

  http://www.unidata.ucar.edu/netcdf/docs/
  http://www.unidata.ucar.edu/netcdf/docs/building.html

It looks like we should include a new link on building and installing the C++ 
library.
It's not as widely used as the C or Fortran libraries and it's installation 
documentation
has been neglected during our transition to a different documentation system 
(doxygen).

For now there's this:

  
http://www.unidata.ucar.edu/mailing_lists/archives/netcdfgroup/2011/msg00365.html

and the generic instructions you get by running

  ./configure --help

from the top level of the netcdf-cxx source directory, that tell you what 
environment
variables to set before you run

  ./configure
  make check
  make install

--Russ

> I have been attempting to follow the netCDF tutorial for C++ located at
> http://www.unidata.ucar.edu/software/netcdf/examples/programs/
> 
> I have also downloaded the netcdf-cxx-4.2.tar files that contain a few
> .h files (including a netcdf.hh in the cxx sub directory). I am having
> problems compiling the examples on your website. Specifically, I cannot
> compile simple_xy_wr.cpp
> 
> I am new to C++, especially compiling programs in Linux. Here is the
> command I entered and the errors that followed:
> 
> [felix@arra ~/cpp]$ g++ -Wall -I/rhome/felix/cpp/netcdf-cxx-4.2/cxx/ -o
> simple_xy_wr simple_xy_wr.cpp
> In file included from /rhome/felix/cpp/netcdf-cxx-4.2/cxx/netcdfcpp.h:13,
> from simple_xy_wr.cpp:19:
> /rhome/felix/cpp/netcdf-cxx-4.2/cxx/ncvalues.h:16:20: error: netcdf.h:
> No such file or directory
> /rhome/felix/cpp/netcdf-cxx-4.2/cxx/ncvalues.h:35: error: 'nc_type' was
> not declared in this scope
> /rhome/felix/cpp/netcdf-cxx-4.2/cxx/ncvalues.h:35: error: expected `)'
> before numeric constant
> /rhome/felix/cpp/netcdf-cxx-4.2/cxx/ncvalues.h:46: error: 'NC_FILL_BYTE'
> was not declared in this scope
> /rhome/felix/cpp/netcdf-cxx-4.2/cxx/ncvalues.h:47: error: 'NC_FILL_CHAR'
> was not declared in this scope
> /rhome/felix/cpp/netcdf-cxx-4.2/cxx/ncvalues.h:48: error:
> 'NC_FILL_SHORT' was not declared in this scope
> /rhome/felix/cpp/netcdf-cxx-4.2/cxx/ncvalues.h:49: error: 'nclong' does
> not name a type
> /rhome/felix/cpp/netcdf-cxx-4.2/cxx/ncvalues.h:50: error: 'NC_FILL_INT'
> was not declared in this scope
> /rhome/felix/cpp/netcdf-cxx-4.2/cxx/ncvalues.h:51: error: 'FILL_LONG'
> was not declared in this scope
> /rhome/felix/cpp/netcdf-cxx-4.2/cxx/ncvalues.h:52: error:
> 'NC_FILL_FLOAT' was not declared in this scope
> /rhome/felix/cpp/netcdf-cxx-4.2/cxx/ncvalues.h:53: error:
> 'NC_FILL_DOUBLE' was not declared in this scope
> /rhome/felix/cpp/netcdf-cxx-4.2/cxx/ncvalues.h:274: error: expected ','
> or '...' before '*' token
> /rhome/felix/cpp/netcdf-cxx-4.2/cxx/ncvalues.h:274: error: ISO C++
> forbids declaration of 'nclong' with no type
> /rhome/felix/cpp/netcdf-cxx-4.2/cxx/ncvalues.h:274: error: ISO C++
> forbids declaration of 'nclong' with no type
> /rhome/felix/cpp/netcdf-cxx-4.2/cxx/ncvalues.h:274: error: expected ';'
> before '*' token
> /rhome/felix/cpp/netcdf-cxx-4.2/cxx/netcdfcpp.h:99: error: 'NC_FILL' was
> not declared in this scope
> /rhome/felix/cpp/netcdf-cxx-4.2/cxx/netcdfcpp.h:100: error: 'NC_NOFILL'
> was not declared in this scope
> /rhome/felix/cpp/netcdf-cxx-4.2/cxx/netcdfcpp.h: In member function
> 'const char* NcError::get_errmsg()':
> /rhome/felix/cpp/netcdf-cxx-4.2/cxx/netcdfcpp.h:459: error:
> 'nc_strerror' was not declared in this scope
> simple_xy_wr.cpp: In function 'int main()':
> simple_xy_wr.cpp:68: error: 'ncInt' was not declared in this scope
> 
> my g++ version is 4.1.2
> 
> I would appreciate any assistance.
> -Mariana Scott
> 
> 
Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: FBR-789563
Department: Support netCDF
Priority: Normal
Status: Closed