<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="MSHTML 11.00.9600.18817">
<style id="owaParaStyle">P {
        MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px
}
</style>
</head>
<body fPStyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<div DanaPrelude="1">
<p>Hi list,</p>
<p> </p>
<p>I am using mingw64 GCC to build gdal-2.2.2 and got the following error.</p>
<p>gdal-2.1.4. was built fine. and I couldn't find syntax difference in cpl_port.h between gdal 2.2.2 and 2.1.4.</p>
<div style="FONT-SIZE: 13px; FONT-FAMILY: Tahoma">
<div class="BodyFragment"><font size="2"><font face="Tahoma">
<div class="PlainText"></font> </div>
<div class="PlainText"><font face="Tahoma">Thanks,<br>
Shawn<br>
</font></div>
<div class="PlainText"><font face="Tahoma"></font> </div>
<div class="PlainText"><font face="Tahoma">building 'osgeo._gdal_array' extension<br>
C:\msys64\mingw64\bin/x86_64-w64-mingw32-gcc.exe -fno-strict-aliasing -march=x86-64 -mtune=generic -O2 -pipe -fwrapv -D__USE_MINGW_ANSI_STDIO=1 -DNDEBUG -DNDEBUG -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps
 -IC:/msys64/mingw64/include/python2.7 -IC:/msys64/mingw64/lib/python2.7/site-packages/numpy/core/include -Iinclude -c extensions/gdal_array_wrap.cpp -o build/temp.mingw-2.7/extensions/gdal_array_wrap.o<br>
In file included from ../../gcore/gdal.h:42:0,<br>
                 from extensions/gdal_array_wrap.cpp:3143:<br>
<font color="#ff0000">../../port/cpl_port.h:1119:5: </font><font color="#ff0000">error: conflicting declaration of 'int sprintf(char*, const char*, ...)' with 'C' linkage</font><br>
 int sprintf(char *str, const char* fmt, ...) CPL_PRINT_FUNC_FORMAT(2, 3) CPL_WARN_DEPRECATED("Use snprintf() or CPLsnprintf() instead");<br>
     ^~~~~~~<br>
In file included from C:/msys64/mingw64/include/python2.7/Python.h:33:0,<br>
                 from extensions/gdal_array_wrap.cpp:172:<br>
C:/msys64/mingw64/x86_64-w64-mingw32/include/stdio.h:316:5: note: previous declaration with 'C++' linkage<br>
 int sprintf (char *__stream, const char *__format, ...)<br>
     ^~~~~~~<br>
In file included from C:/msys64/mingw64/include/python2.7/numpy/ndarraytypes.h:1809:0,<br>
                 from C:/msys64/mingw64/include/python2.7/numpy/ndarrayobject.h:18,<br>
                 from C:/msys64/mingw64/include/python2.7/numpy/arrayobject.h:4,<br>
                 from extensions/gdal_array_wrap.cpp:3464:<br>
C:/msys64/mingw64/include/python2.7/numpy/npy_1_7_deprecated_api.h:13:79: note: #pragma message: C:/msys64/mingw64/include/python2.7/numpy/npy_1_7_deprecated_api.h(12) : Warning Msg: Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API
 NPY_1_7_API_VERSION<br>
                          "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION")<br>
                                                                               ^<br>
error: command 'C:\\msys64\\mingw64\\bin/x86_64-w64-mingw32-gcc.exe' failed with exit status 1<br>
make[2]: *** [GNUmakefile:68: build] Error 1<br>
make[2]: Leaving directory '/c/build64/gdal-2.2.2/swig/python'<br>
make[1]: *** [GNUmakefile:30: build] Error 2<br>
make[1]: Leaving directory '/c/build64/gdal-2.2.2/swig'<br>
make: *** [GNUmakefile:103: swig-modules] Error 2<br>
</div>
</font></font></div>
</div>
</div>
</div>
</body>
</html>