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.
>To: address@hidden >From: "Kurt Stockinger" <address@hidden> >Subject: Re: 20040401:HDF-netCDF conflicts >Organization: LBL >Keywords: 200403312247.i2VMlQA6008230 Kurt, > >I suggest that you not link with the "mfhdf" library, so try removing > >"-lmfhdf" from the link lines. If I remember correctly, the MFHDF > >library provides a netCDF-2 API on top of the HDF4 file format, so > >would have name clashes with the netCDF-3 library that also has > >backward-compatibility support for the netCDF-2 API. You also might > >need to remove any includes you have for mfhdf.h, since that may > >define some conflicting symbols or prototypes. > > > > > Hi Russ, > > If I don't link with "mfhdf", the SD-function calls are not understood. > Is there an alternative? > > thanks, > Kurt > > [kurts@dmx fast-bit]$ make > g++ -Wall -o fast HDFReader.cpp NetCDFReader.cpp FastBit.cpp > -I/software/netcdf-3.5.1b12/include -I/software/hdf4/include -I../ibis > -L/software/netcdf-3.5.1b12/lib -L/software/hdf4/lib -L../ibis -ldf > -ljpeg -lz -lnetcdf -libis -lpthread -lm -lrt > HDFReader.cpp: In method `int Reader::readHdf(const char *, const char *)': > HDFReader.cpp:72: implicit declaration of function `int SDstart(...)' > HDFReader.cpp:75: implicit declaration of function `int SDfileinfo(...)' > HDFReader.cpp:83: implicit declaration of function `int SDselect(...)' > HDFReader.cpp:84: implicit declaration of function `int SDgetinfo(...)' > HDFReader.cpp:98: implicit declaration of function `int SDattrinfo(...)' > HDFReader.cpp:131: implicit declaration of function `int SDreaddata(...)' > HDFReader.cpp:176: implicit declaration of function `int SDendaccess(...)' > HDFReader.cpp:179: implicit declaration of function `int SDend(...)' This looks like you're missing the prototypes for the SD-function calls, and I would think those would be in an include file, not a library. Does g++ get prototypes from compiled libraries? Maybe you removed an include for mdhdf.h which in turn included a header file for the SD functions, so you now need to include that header file explicitly? Sorry, but questions in any more depth about how HDF4 structures their header files would be best answered by the HDF helpdesk, at address@hidden. I'm CC:ing them on this message, in case they know the answer (please CC: me in the reply). --Russ