[gdal-dev] Building with recent versions of Visual Studio 2019 fails due to cstdint problems C2039 C2873 

Millman, Mark Mark.Millman at Woolpert.com
Mon Jun 8 11:08:39 PDT 2020


I've been building GDAL for the last 8 years or so for almost every new release.  And I successfully built version 2.4.1 with Visual Studio 2019 when it first came out.  However, I am no longer able to build V2.4.1 or V3.0.4 or V3.1.0 with the latest releases of Visual Studio 2019.  I get error C2039 and C2873 indicating a conflict with cstdint and the global namespace.  I've installed fresh copies of Visual Studio and replicated the issue on three different machines.  I have tried adding both /std:c++14 and /std:c++17 switches to OPTFLAGS but I get the same results.

Has anyone else successfully built GDAL with VS 2019 (V16.5.4 or higher)?  Can anyone offer any suggestions?

Thank you -- Mark Millman

Example output from
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall" x64
nmake -f makefile.vc MSVC_VER=1920 WIN64=1 WITH_PDB=1 DLLBUILD=1

        cl  /Zi /Fd..\gdal204.pdb /nologo /MP /MD /EHsc /Ox /FC /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DNDEBUG /std:c++17 /W4 /wd4127 /wd4251 /wd4275 /wd4786 /wd4100 /wd4245 /wd4206 /wd4351 /wd4611  /DHAVE_SSE_AT_COMPILE_TIME /DHAVE_SSSE3_AT_COMPILE_TIME -I..\port -I..\ogr -I..\gcore  -I..\alg -I..\ogr\ogrsf_frmts  -I..\gnm -I..\gnm\gnm_frmts -I..\apps /DHAVE_AVX_AT_COMPILE_TIME -I../frmts/vrt -I../ogr/ogrsf_frmts -IC:\OpenSource\gdal-2.4.1\geos/capi -IC:\OpenSource\gdal-2.4.1\geos\include -DHAVE_GEOS -DPROJ_STATIC -DPROJ_VERSION=5 -IC:\Programs\OSGeo4W64\include -Imarching_squares -DINTERNAL_QHULL  -DGNM_ENABLED  -DGDAL_COMPILATION -DNOMINMAX  /c gdalgridsse.cpp
gdalgridsse.cpp
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.25.28610\include\cstdint(22): error C2039: 'int8_t': is not a member of '`global namespace''
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.25.28610\include\cstdint(22): error C2873: 'int8_t': symbol cannot be used in a using-declaration
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.25.28610\include\cstdint(23): error C2039: 'int16_t': is not a member of '`global namespace''
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.25.28610\include\cstdint(23): error C2873: 'int16_t': symbol cannot be used in a using-declaration
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.25.28610\include\cstdint(24): error C2039: 'int32_t': is not a member of '`global namespace''



Mark Millman
Woolpert Inc -- Geospatial
702-799-9968
mark.millman at woolpert.com<mailto:mark.millman at woolpert.com>
Anacortes, WA



WARNING - The information contained in this communication may contain technical data whose export is restricted by the Arms Export Control Act (Title 22, U.S.C., Sec 2751, et seq.) or the Export Administration Act of 1979, as amended (Title 50, U.S.C., App. 2401 et seq.). Violations of these export laws are subject to severe criminal penalties. If you have received this communication in error, please return it to the sender immediately and delete the original message and any copy of it from your computer system. If you have any questions concerning this message, please contact the sender.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200608/1fa32246/attachment.html>


More information about the gdal-dev mailing list