<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16735" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT size=2><FONT size=1>
<P><FONT face=Arial size=2><SPAN class=580031311-28102008>Hello,
list...</SPAN></FONT></P></DIV>
<DIV><FONT><SPAN class=580031311-28102008><FONT face=Arial size=2>I am trying to
compile GDAL 1.5.3 with HDF and GRIB drivers, under MSVC 2005-SP1, using the
project files distributed at </FONT><A
href="http://vterrain.org/Distrib/gdal.html"><FONT face=Arial
size=2>http://vterrain.org/Distrib/gdal.html</FONT></A><FONT face=Arial size=2>.
</FONT></SPAN></FONT><FONT face=Arial size=2><SPAN class=580031311-28102008>I
have installed pre-built binaries for HDF42r3 and HDF5-1.8.1. and the libraries
they depend on. </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=580031311-28102008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=580031311-28102008>I seem to get a
conflict between the GDAL file hdf4dataset.h and the HDF4 file mfhdfi.h
concerning 'UNKNOWN' as an enum definition:</SPAN></FONT></DIV>
<DIV><FONT><SPAN class=580031311-28102008></SPAN></FONT><FONT face=Arial
size=2>1>c:\program files\gdal-1.5.3\frmts\hdf4\hdf4dataset.h(55) : error
C2365: 'UNKNOWN' : redefinition; previous definition was
'enumerator'</FONT></DIV>
<DIV><FONT face=Arial size=2>1> c:\program files\hdf42r3\include\mfhdfi.h(26)
: see declaration of 'UNKNOWN'</FONT></DIV></FONT></FONT>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=580031311-28102008>The revelant code
appears as </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=580031311-28102008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=580031311-28102008>in mfhdfi.h:
(#included in mfhdf.h, which is #included in hdf4dataset.cpp and
hdf4imagedataset.cpp).</SPAN></FONT></DIV>
<DIV><FONT><SPAN class=580031311-28102008><FONT color=#0000ff><FONT face=Arial
size=2>typedef</FONT><FONT face=Arial size=2> </FONT><FONT face=Arial
size=2>enum</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2>{</FONT></DIV>
<DIV><FONT face=Arial size=2>IS_SDSVAR=0, </FONT><FONT color=#008000><FONT
face=Arial size=2>/* variable is an actual SDS */</FONT></DIV></FONT>
<DIV><FONT face=Arial size=2>IS_CRDVAR=1, </FONT><FONT color=#008000><FONT
face=Arial size=2>/* variable is a coordinate variable */</FONT></DIV></FONT>
<DIV><FONT size=2><FONT face=Arial>UNKNOWN=2 <SPAN
class=580031311-28102008><FONT color=#008000> </FONT></SPAN></FONT><FONT
face=Arial color=#008000>/* variable is created before HDF4.2r2, unknown type
*/</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2>} hdf_vartype_t;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=580031311-28102008><FONT face=Arial size=2>and in
hdf4dataset.h:</FONT></SPAN></DIV>
<DIV><SPAN class=580031311-28102008><FONT size=2><FONT face=Arial
color=#0000ff>typedef</FONT></FONT><FONT face=Arial><FONT color=#0000ff><FONT
size=2> </FONT><FONT size=2>enum</FONT></FONT><FONT size=2> </FONT></FONT><FONT
color=#008000 size=2><FONT face=Arial color=#000000>// Types of data
products:</FONT></DIV></FONT><FONT size=2>
<DIV><FONT face=Arial>{</FONT></DIV>
<DIV><FONT face=Arial>GDAL_HDF4, </FONT></FONT><FONT color=#008000 size=2><FONT
face=Arial>// HDF written by GDAL</FONT></DIV></FONT><FONT size=2>
<DIV><FONT face=Arial>EOS_GRID, </FONT></FONT><FONT color=#008000 size=2><FONT
face=Arial>// HDF-EOS Grid</FONT></DIV></FONT><FONT size=2>
<DIV><FONT face=Arial>EOS_SWATH, </FONT></FONT><FONT color=#008000 size=2><FONT
face=Arial>// HDF-EOS Swath</FONT></DIV></FONT><FONT size=2>
<DIV><FONT face=Arial>EOS_SWATH_GEOL, </FONT></FONT><FONT color=#008000
size=2><FONT face=Arial>// HDF-EOS Swath Geolocation
Array</FONT></DIV></FONT><FONT size=2>
<DIV><FONT face=Arial>SEAWIFS_L1A, </FONT></FONT><FONT color=#008000
size=2><FONT face=Arial>// SeaWiFS Level-1A Data</FONT></DIV></FONT><FONT
size=2>
<DIV><FONT face=Arial>SEAWIFS_L2, </FONT></FONT><FONT color=#008000 size=2><FONT
face=Arial>// SeaWiFS Level-2 Data</FONT></DIV></FONT><FONT size=2>
<DIV><FONT face=Arial>SEAWIFS_L3, </FONT></FONT><FONT color=#008000 size=2><FONT
face=Arial>// SeaWiFS Level-3 Standard Mapped Image</FONT></DIV></FONT><FONT
size=2>
<DIV><FONT face=Arial>HYPERION_L1, </FONT></FONT><FONT color=#008000
size=2><FONT face=Arial>// Hyperion L1 Data Product</FONT></DIV></FONT>
<DIV><FONT face=Arial size=2>UNKNOWN</FONT></DIV>
<DIV><FONT face=Arial size=2>} HDF4SubdatasetType;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=580031311-28102008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=580031311-28102008><FONT face=Arial size=2>A couple of
additional errors seems to follow from this
conflict:</FONT></SPAN></DIV>
<DIV><SPAN class=580031311-28102008><FONT size=1><FONT
size=2>1>..\..\frmts\hdf4\hdf4imagedataset.cpp(2294) : error C2440: '=' :
cannot convert from 'hdf_vartype_t' to 'HDF4SubdatasetType'</FONT></DIV>
<DIV><FONT size=2>1> Conversion to enumeration type requires an explicit cast
(static_cast, C-style cast or function-style cast)</FONT></DIV>
<DIV><FONT size=2>1>..\..\frmts\hdf4\hdf4dataset.cpp(744) : error C2440: '='
: cannot convert from 'hdf_vartype_t' to 'HDF4SubdatasetType'</FONT></DIV>
<DIV><FONT size=2>1> Conversion to enumeration type requires an explicit cast
(static_cast, C-style cast or function-style cast)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV> </DIV>
<DIV></FONT></SPAN><SPAN class=580031311-28102008><FONT><FONT face=Arial
size=2>Is this because I downloaded the latest pre-built HDF4 (4.2r3) and
thus ignored the </FONT><A href="http://trac.osgeo.org/gdal/wiki/HDF"><FONT
face=Arial size=2>http://trac.osgeo.org/gdal/wiki/HDF</FONT></A><FONT face=Arial
size=2> stating "</FONT></FONT></SPAN><SPAN class=580031311-28102008><FONT
face=Arial size=2>HDF 4.2r1 is generally the preferred version if working from
source"?</FONT></SPAN></DIV>
<DIV><SPAN class=580031311-28102008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=580031311-28102008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=580031311-28102008></SPAN> </DIV>
<P></SPAN></SPAN></FONT><SPAN class=580031311-28102008><FONT face=Arial
size=2>Also, in hdf4imagedataset.cpp lines 854 to 859 go:</FONT></SPAN></P>
<DIV><FONT><SPAN class=580031311-28102008><FONT face=Arial size=2><FONT
color=#0000ff>if</FONT> ( (SDsetattr( hSD, pszName, DFNT_CHAR8,</FONT></DIV>
<DIV><FONT face=Arial size=2>strlen(pszValue) + 1, pszValue )) < 0
);</FONT></DIV>
<DIV><FONT face=Arial size=2>{</FONT></DIV>
<DIV><FONT face=Arial size=2>CPLDebug( "HDF4Image",</FONT></DIV>
<DIV><FONT face=Arial size=2>"<FONT color=#ff0000>Cannot write metadata
information to output file</FONT>");</FONT></DIV>
<DIV><FONT face=Arial size=2>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV></SPAN></FONT><SPAN class=580031311-28102008><FONT face=Arial size=2>in
which the semicolon ending the IF statement prevents the CPLDebug from ever
being executed. Is this intentional?</FONT></SPAN></DIV>
<DIV><SPAN class=580031311-28102008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=580031311-28102008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=580031311-28102008><FONT face=Arial size=2>Regards,
</FONT></SPAN><SPAN class=580031311-28102008><FONT face=Arial size=2>Sjur K
:-)</FONT></SPAN></DIV>
<DIV><SPAN class=580031311-28102008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<P><FONT size=2>Sjur Kolberg<BR>SINTEF Energiforskning A/S<BR>Sem Sælands vei
11<BR>7465 Trondheim<BR>tlf. 73 59 72 78<BR>fax 73 59 72 50 </FONT></P>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>