[gdal-dev] mingw64 build error gdal-2.2.2
Shawn Gong
SGONG at mdacorporation.com
Tue Oct 31 12:02:20 PDT 2017
Hi list,
I am using mingw64 GCC to build gdal-2.2.2 and got the following error.
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.
Thanks,
Shawn
building 'osgeo._gdal_array' extension
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
In file included from ../../gcore/gdal.h:42:0,
from extensions/gdal_array_wrap.cpp:3143:
../../port/cpl_port.h:1119:5: error: conflicting declaration of 'int sprintf(char*, const char*, ...)' with 'C' linkage
int sprintf(char *str, const char* fmt, ...) CPL_PRINT_FUNC_FORMAT(2, 3) CPL_WARN_DEPRECATED("Use snprintf() or CPLsnprintf() instead");
^~~~~~~
In file included from C:/msys64/mingw64/include/python2.7/Python.h:33:0,
from extensions/gdal_array_wrap.cpp:172:
C:/msys64/mingw64/x86_64-w64-mingw32/include/stdio.h:316:5: note: previous declaration with 'C++' linkage
int sprintf (char *__stream, const char *__format, ...)
^~~~~~~
In file included from C:/msys64/mingw64/include/python2.7/numpy/ndarraytypes.h:1809:0,
from C:/msys64/mingw64/include/python2.7/numpy/ndarrayobject.h:18,
from C:/msys64/mingw64/include/python2.7/numpy/arrayobject.h:4,
from extensions/gdal_array_wrap.cpp:3464:
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
"#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION")
^
error: command 'C:\\msys64\\mingw64\\bin/x86_64-w64-mingw32-gcc.exe' failed with exit status 1
make[2]: *** [GNUmakefile:68: build] Error 1
make[2]: Leaving directory '/c/build64/gdal-2.2.2/swig/python'
make[1]: *** [GNUmakefile:30: build] Error 2
make[1]: Leaving directory '/c/build64/gdal-2.2.2/swig'
make: *** [GNUmakefile:103: swig-modules] Error 2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20171031/d3d1e5b5/attachment.html>
More information about the gdal-dev
mailing list