Ticket #2296 (closed defect: fixed)

Opened 6 months ago

Last modified 6 months ago

hdf4dataset.h:54: error: conflicting declaration 'UNKNOWN'

Reported by: vincentschut Assigned to: warmerdam
Priority: normal Milestone:
Component: default Version: svn-trunk
Severity: normal Keywords:
Cc: dron

Description

New linux flavour, new issues... While building gdal (from svn, combined with a home-brewn hdf4) I came accross the following problem:

libtool: compile: g++ -g -O2 -Wall -I/usr/local/src/tmp/gdal/port -I/usr/local/src/tmp/gdal/gcore -I/usr/local/src/tmp/gdal/alg -I/usr/local/src/tmp/gdal/ogr -I/usr/local/src/tmp/gdal/ogr/ogrsf_frmts -I/usr/local/src/tmp/gdal/ogr -Ihdf-eos -DOGR_ENABLED -I/usr/local/src/tmp/gdal/port -c hdf4dataset.cpp -fPIC -DPIC -o ../o/.libs/hdf4dataset.o In file included from hdf4dataset.cpp:39: hdf4dataset.h:54: error: conflicting declaration 'UNKNOWN' /usr/include/mfhdfi.h:25: error: 'UNKNOWN' has a previous declaration as 'hdf_vartype_t UNKNOWN' hdf4dataset.cpp: In static member function 'static GDALDataset* HDF4Dataset::Open(GDALOpenInfo*)': hdf4dataset.cpp:743: error: cannot convert 'hdf_vartype_t' to 'HDF4SubdatasetType' in assignment make[2]: *** ../o/hdf4dataset.o Error 1

Which can be solved by changing the 'UNKNOWN' in the gdal enum (and references thereof) to some other name, like 'UNKNOWNPRODUCT'.

Attached is a patch that does the above, which fixes the issue for me.

Attachments

gdal-hdf4-UNKNOWN.diff (1.3 kB) - added by vincentschut on 03/27/08 10:54:40.

Change History

03/27/08 10:54:40 changed by vincentschut

  • attachment gdal-hdf4-UNKNOWN.diff added.

03/27/08 11:12:47 changed by dron

  • status changed from new to closed.
  • cc set to dron.
  • resolution set to fixed.

That should be now fixed in trunk with r14096. I did it a bit different than suggested by adding H4ST prefix to members of HDF4SubdatasetType enumeration.

Best regards, Andrey