您的位置:首页 > 其它

Windows7 编译 GDAL 库

2016-01-12 16:39 302 查看

Windows7 编译 GDAL 库

下面的方法已测试成功!

1. 下载GDAL源码  http://trac.osgeo.org/gdal/wiki/DownloadSource



2. 定义环境变量 GDAL_HOME  为GDAL根目录

3. 打开cmd,进入到GDAL根目录,执行命令: makegdal_gen.bat 10.00 32 > makegdal10.vcproj   生成解决方案。

命令解释: 可执行以下makegdal_gen.bat,不加任何参数,会提示帮助。

10.00    对应VS2010,  9.00    对应VS2008。

32   或 64   表示生成位数。



4. 打开解决方案,生成就可以了。在
GDAL_HOME 目录下会生成几个文件,包括bin、lib、include、data等。

其它生成的方式是nmake命令生成。

需要修改 nmake.opt 文件,GDAL_HOME 为安装路径。

执行命令:

nmake -f makefile.vc MSVC_VER=1600 DEBUG=1 ANALYZE=1 WITH_PDB=1

nmake -f makefile.vc install

安装开发版本: nmake -f makefile.vc  devinstall

命令说明:

# Usage examples (see details below):

# nmake -f makefile.vc

# nmake -f makefile.vc MSVC_VER=1400

# nmake -f makefile.vc MSVC_VER=1500 DEBUG=1

# nmake -f makefile.vc MSVC_VER=1600 DEBUG=1 ANALYZE=1

# nmake -f makefile.vc MSVC_VER=1600 DEBUG=1 ANALYZE=1 WITH_PDB=1

#

# Options:

#    DEBUG - set to disable optimizations and link with debug runtimes; also implies WITH_PDB.

#  ANALYZE - set to enable code analysis output.

# WITH_PDB - set to enable output of PDB files, supported for both debug and release modes.

这里收集了一篇很详细的文章: http://www.cnblogs.com/bigbigtree/archive/2011/11/20/2256434.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Windows 编译GDAL DEBUG