[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 20040401:HDF-netCDF conflicts
- Subject: Re: 20040401:HDF-netCDF conflicts
- Date: Thu, 01 Apr 2004 10:11:11 -0700
>To: address@hidden
>From: address@hidden
>Subject: BOUNCE address@hidden: Non-member submission from [Kurt Stockinger
><address@hidden>]
>Organization: UCAR/Unidata
>Keywords: 200403312247.i2VMlQA6008230
Hi Kurt,
> I'm using HDF4 and netCDF in the same program and get the following
> conflicts. Any idea how to solve them?
>
> 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
> -L/software/netcdf-3.5.1b12/lib -L/software/hdf4/lib -lmfhdf -ldf
> -ljpeg -lz -lnetcdf
> /software/netcdf-3.5.1b12/lib/libnetcdf.a(nc.o): In function `NC_check_id':
> nc.o(.text+0x6c): multiple definition of `NC_check_id'
> /software/hdf4/lib/libmfhdf.a(file.o)(.text+0x0): first defined here
> /usr/bin/ld: Warning: size of symbol `NC_check_id' changed from 100 to
> 54 in /software/netcdf-3.5.1b12/lib/libnetcdf.a(nc.o)
> /software/netcdf-3.5.1b12/lib/libnetcdf.a(var.o): In function
> `NC_var_shape':
> var.o(.text+0x4c8): multiple definition of `NC_var_shape'
> /software/hdf4/lib/libmfhdf.a(var.o)(.text+0x284): first defined here
> /usr/bin/ld: Warning: size of symbol `NC_var_shape' changed from 802 to
> 272 in /software/netcdf-3.5.1b12/lib/libnetcdf.a(var.o)
> /software/netcdf-3.5.1b12/lib/libnetcdf.a(attr.o): In function
> `NC_findattr':
> attr.o(.text+0x3bc): multiple definition of `NC_findattr'
> /software/hdf4/lib/libmfhdf.a(attr.o)(.text+0x23c): first defined here
> /usr/bin/ld: Warning: size of symbol `NC_findattr' changed from 156 to
> 139 in /software/netcdf-3.5.1b12/lib/libnetcdf.a(attr.o)
> collect2: ld returned 1 exit status
> make: *** [fast] Error 1
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.
--Russ
_____________________________________________________________________
Russ Rew UCAR Unidata Program
address@hidden http://www.unidata.ucar.edu/staff/russ