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

Re: New version of Ncview is now available.



Hi David,

> Please note that you need the latest *standard* version of the netCDF library
> to compile Ncview.  It doesn't presently work if you've installed the
> experimental C++ interface, due to changes in the netCDF header files. 

Actually I think it will work if you put the following declarations at the
top of your file_netcdf.c (or in one of the header files it includes):

    typedef char                ncchar;
    typedef unsigned char       ncbyte;
    typedef short               ncshort;
    typedef double              ncdouble;
    typedef float               ncfloat;

These typedefs were not part of the documented interface (only "nclong" was
ever documented), and I didn't even know they had been added to the netcdf.h
header code for netCDF 2.3.2 before it was released.  The way they were
defined in version 2.3.2 was wrong, with "ncbyte" defined as "char" rather
than "unsigned char".  This conflicted with the C++ extension, preventing it
from compiling.  A later patch deleted them, but apparently the cat was
already out of the bag.

I guess we'll have to add these back in to netcdf.h sooner than I wanted to,
since otherwise applications will be using "ncbyte" in two different and
incompatible ways.

One way to make the ncview source code independent of this inconsistency so
that it would work with all the versions of the netcdf.h header file would
be to use different names for your typedefs, e.g. nc_byte, nc_char, etc. and
declare them at the top of file_netcdf.c.

--Russ