利用VS2010编译GDAL-1.9.2
1. 解压gdal-1.9.2.tar.gz到C:\gdal-1.9.2
2. 修改安装配置文件存放的位置。 打开文件 C:\gdal-1.9.2\nmake.opt ,
(1) 在安装目录下新建文件夹 C:\gdal-1.9.2\build , 并修改 GDAL_HOME = "C:\gdal-1.9.2\build" 。
(2) 修改默认编译环境
# Check version of Visual C++ compiler:
# nmake -f makefile.vc MSVC_VER=xxxx
# where xxxx is one of following:
# 1700 = 11.0(2011)
# 1600 = 10.0(2010)
# 1500 = 9.0 (2008)
# 1400 = 8.0 (2005) - specific compilation flags, different from older VC++
# 1310 = 7.1 (2003)
# 1300 = 7.0 (2002)
# 1200 = 6.0
#
!IFNDEF MSVC_VER
#assume msvc VS2008.
MSVC_VER=1500
!ENDIF
# nmake -f makefile.vc MSVC_VER=xxxx
# where xxxx is one of following:
# 1700 = 11.0(2011)
# 1600 = 10.0(2010)
# 1500 = 9.0 (2008)
# 1400 = 8.0 (2005) - specific compilation flags, different from older VC++
# 1310 = 7.1 (2003)
# 1300 = 7.0 (2002)
# 1200 = 6.0
#
!IFNDEF MSVC_VER
#assume msvc VS2008.
MSVC_VER=1500
!ENDIF
上面源文件中表示默认用VS2008编译,即MSVC_VER