Ticket #2103 (assigned defect)

Opened 7 months ago

Last modified 1 month ago

VC6 build problems with GDAL 1.5

Reported by: warmerdam Assigned to: warmerdam (accepted)
Priority: normal Milestone:
Component: ConfigBuild Version: 1.5.0 betas/RCs
Severity: normal Keywords: vc6 std
Cc: mloskot

Change History

12/18/07 15:50:31 changed by warmerdam

  • status changed from new to assigned.
        cl /nologo /MDd /EHsc /Zi /DDEBUG /D_DEBUG /Fd..\gdal.pdb -I..\port -I..
\ogr -I..\gcore  -I..\alg -DWIN32 -I. -Iogrsf_frmts -I..\frmts\gtiff\libgeotiff
    -DOGR_ENABLED  /c ogrfeaturestyle.cpp
ogrfeaturestyle.cpp
ogrfeaturestyle.cpp(1184) : error C2562: 'OGR_ST_SetUnit' : 'void' function retu
rning a value
        ogr_api.h(386) : see declaration of 'OGR_ST_SetUnit'
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'c:\Software\VStudio\VC98\BIN\nmake.exe' : return cod
e '0x2'

12/18/07 15:53:33 changed by warmerdam

also:

        cl /nologo /MDd /EHsc /Zi /DDEBUG /D_DEBUG /Fd..\gdal.pdb -I..\port -I.
\ogr -I..\gcore  -I..\alg -DWIN32 -I. -Iogrsf_frmts -I..\frmts\gtiff\libgeotiff
    -DOGR_ENABLED  /c ogr_srs_esri.cpp
ogr_srs_esri.cpp
ogr_srs_esri.cpp(332) : error C2446: '!=' : no conversion from 'const char ** '
to 'char ** '
        Conversion loses qualifiers
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.

12/18/07 15:57:52 changed by warmerdam

Also:

C:\warmerda\wrk\gdal\ogr\ogrsf_frmts>cd geojson   && nmake /NOLOGO /f makefile.v
c   && cd ..
        cl /nologo /MDd /EHsc /Zi /DDEBUG /D_DEBUG /Fd..\..\..\gdal.pdb -I..\..\
..\port -I..\..\..\ogr -I..\..\..\gcore  -I..\..\..\alg -I. -I.. -I..\..  /c ogr
geojsondatasource.cpp
ogrgeojsondatasource.cpp
ogrgeojsondatasource.cpp(334) : error C2039: 'size_t' : is not a member of 'std'

NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.

12/18/07 16:02:25 changed by warmerdam

also:

        cd libtiff
        nmake /nologo /f makefile.vc
        cl /nologo /MDd /EHsc /Zi /DDEBUG /D_DEBUG /Fd..\..\..\gdal.pdb -I..\..\
..\port -I..\..\..\ogr -I..\..\..\gcore  -I..\..\..\alg -I..\..\zlib -DZIP_SUPPO
RT -DPIXARLOG_SUPPORT -I..\..\jpeg\libjpeg -DJPEG_SUPPORT -DOJPEG_SUPPORT  /c ti
f_dirread.c
tif_dirread.c
tif_dirread.c(2502) : error C2520: conversion from unsigned __int64 to double no
t implemented, use signed __int64
tif_dirread.c(658) : error C2520: conversion from unsigned __int64 to double not
 implemented, use signed __int64
tif_dirread.c(2268) : error C2520: conversion from unsigned __int64 to double no
t implemented, use signed __int64
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'c:\Software\VStudio\VC98\BIN\nmake.exe' : return cod
e '0x2'
Stop.

12/18/07 16:13:51 changed by warmerdam

Also:

        cl /nologo /MDd /EHsc /Zi /DDEBUG /D_DEBUG /Fd..\..\..\gdal.pdb -I..\..\
..\port -I..\..\..\ogr -I..\..\..\gcore  -I..\..\..\alg -I..\..\zlib -DZIP_SUPPO
RT -DPIXARLOG_SUPPORT -I..\..\jpeg\libjpeg -DJPEG_SUPPORT -DOJPEG_SUPPORT  /c ti
f_ojpeg.c
tif_ojpeg.c
tif_ojpeg.c(585) : error C2632: 'long' followed by 'long' is illegal
tif_ojpeg.c(587) : error C2632: 'long' followed by 'long' is illegal
tif_ojpeg.c(592) : error C2632: 'long' followed by 'long' is illegal
tif_ojpeg.c(599) : error C2632: 'long' followed by 'long' is illegal
tif_ojpeg.c(606) : error C2632: 'long' followed by 'long' is illegal
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'c:\Software\VStudio\VC98\BIN\nmake.exe' : return cod
e '0x2'
Stop.

12/18/07 16:14:05 changed by warmerdam

        cl /nologo /MDd /EHsc /Zi /DDEBUG /D_DEBUG /Fd..\..\gdal.pdb -I..\..\por
t -I..\..\ogr -I..\..\gcore  -I..\..\alg   /c envidataset.cpp
envidataset.cpp
envidataset.cpp(1301) : error C2374: 'i' : redefinition; multiple initialization

        envidataset.cpp(1295) : see declaration of 'i'
envidataset.cpp(1307) : error C2374: 'i' : redefinition; multiple initialization

        envidataset.cpp(1295) : see declaration of 'i'
envidataset.cpp(1313) : error C2374: 'i' : redefinition; multiple initialization

        envidataset.cpp(1295) : see declaration of 'i'
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.

12/18/07 16:17:12 changed by warmerdam

Also:

C:\warmerda\wrk\gdal\frmts>cd pds   && nmake /NOLOGO /f makefile.vc   && cd ..
        cl /nologo /MDd /EHsc /Zi /DDEBUG /D_DEBUG /Fd..\..\gdal.pdb -I..\..\por
t -I..\..\ogr -I..\..\gcore  -I..\..\alg -I..\raw  /c pdsdataset.cpp
pdsdataset.cpp
pdsdataset.cpp(580) : error C2171: '+' : illegal on operands of type 'char [13]'

NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.

12/18/07 16:24:09 changed by warmerdam

Assorted fixes for above problems in r13365.

Some fixes in gdal/frmts/gtiff/libtiff need to be upstreamed into libtiff if we want libtiff4 to work with vc6. Leaving open till that is dealt with.

12/18/07 16:39:18 changed by mloskot

  • cc set to mloskot.

02/07/08 15:04:02 changed by warmerdam

  • milestone deleted.

Clearing 1.5.1 milestone since the only outstanding work is in libtiff.

05/27/08 20:09:53 changed by mloskot

  • keywords changed from vc6 to vc6 std.

Some of these errors are caused by broken std:: namespace in Visual C+++ 6.0.

I think that a clean solution is to control broken compilers with preprocessor macros. Boost does it with success, with macro BOOST_NO_STDC_NAMESPACE

Using this macro, it's easy to fix broken std::, short example

#ifdef BOOST_NO_STDC_NAMESPACE
namespace std {
   using ::size_t;
   using ::sqrt;
}
#endif

void foo()
{
   std::size_t s = 0;
   std::sqrt(4);
}