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

[netCDF #TOQ-874116]: Can NetCDF Work with HDF Within One Application



Hi William,

You have to build the HDF4 library without its netCDF interface,
the "mfhdf" library, so there will be no duplicate function names.

You can do this by building the HDF4 library using the --disable-netcdf
flag to the configure script, as described in the Release Notes for
the January 2008 4.2r3 version of HDF4:

        - Modified the HDF4 mfhdf library and configure to work in the
          absence of the NetCDF-3 header files when the HDF4 library
          is configured with the --disable-netcdf flag. This feature is
          required when building the ESDIS Toolkit in the presence of the
          NetCDF-3 library. In this case, the HDF4 file netcdf.h is used
          to build the HDF4 libraries and is installed under the name
          "hdf4_netcdf.h" to avoid a name clash with the NetCDF-3 file
          netcdf.h.

If you have an older version of HDF4 already installed, there is another
way around the problem, described here:

  http://www.unidata.ucar.edu/support/help/MailArchives/netcdf/msg02412.html

A better way to do this for C++ libraries would be to use C++ namespaces.
However, the current netCDF release does not use namespaces in the
released C++ API in the cxx directory, just in the experimental (and not
yet complete) cxx4 directory of the netCDF-4.0 release.  However, if you
want to try the namespace approach, looking at the cxx4 header files in the
4.0 release shows how this will be done.

--Russ

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: TOQ-874116
Department: Support netCDF
Priority: Normal
Status: Closed