[gdal-dev] python 2.7 bindings with trunk (2.3)

Gregory, Matthew matt.gregory at oregonstate.edu
Fri Jan 5 15:14:16 PST 2018


Thanks Even,

Even Rouault wrote:
> Define
> SET DISTUTILS_USE_SDK=1
> SET MSSdk=1
>  
> so that the active MSVC version is used when building the Python
> bindings. This is what is used in gisinternals builds & appveyor builds

That worked for me (although I would have never found it, so I appreciate your help).  I've put these two lines in gdal/swig/makefile.vc, e.g.

--- a/gdal/swig/makefile.vc
+++ b/gdal/swig/makefile.vc
@@ -20,6 +20,8 @@ python: gdalvars
         $(SWIG) -c++ -python -modern -new_repr -I../include/python -I../include/python/docs -o extensions/ogr_wrap.cpp -outdir osgeo ..\include\ogr.i
         $(SWIG) -c++ -python -modern -new_repr -I../include/python -I../include/python/docs -o extensions/gnm_wrap.cpp -outdir osgeo ..\include\gnm.i
         $(SWIG) -c++ -python -modern -new_repr -I../include/python -I../include/python/docs -o extensions/gdal_array_wrap.cpp -outdir osgeo ..\include\gdal_array.i
+        set DISTUTILS_USE_SDK=1
+        set MSSdk=1
         $(PYDIR)\python.exe setup.py build
 	cd ..

Is this a solution that would work across all branches and compilers?

thanks, matt


More information about the gdal-dev mailing list