﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-图形，诗意之栖居-随笔分类-数字地球</title><link>http://www.cnitblog.com/longhulz/category/8759.html</link><description>充满劳绩，然而人诗意地栖居在大地上。
——[德]荷尔德林</description><language>zh-cn</language><lastBuildDate>Thu, 27 Oct 2011 15:16:51 GMT</lastBuildDate><pubDate>Thu, 27 Oct 2011 15:16:51 GMT</pubDate><ttl>60</ttl><item><title>64位gdal VS2005 32位机下编译</title><link>http://www.cnitblog.com/longhulz/archive/2011/10/24/76184.html</link><dc:creator>龙湖</dc:creator><author>龙湖</author><pubDate>Mon, 24 Oct 2011 09:07:00 GMT</pubDate><guid>http://www.cnitblog.com/longhulz/archive/2011/10/24/76184.html</guid><wfw:comment>http://www.cnitblog.com/longhulz/comments/76184.html</wfw:comment><comments>http://www.cnitblog.com/longhulz/archive/2011/10/24/76184.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/longhulz/comments/commentRss/76184.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/longhulz/services/trackbacks/76184.html</trackback:ping><description><![CDATA[<p><span style="font-family: Lucida Console; font-size: 10pt">被逼得昏头的码农们翻了不少网页，本着别人(包括gdal官方网、google查来的)的&#8220;红宝书&#8221;，一阵鼓捣，那些淘来的，本也是不求甚解，做不得准，一堆尝试，虽然也是成功了，却脱不开舍近求远。按乔布斯的说法，简洁需要更多的劳动，把所得放上来，给忙碌的同道们一点参考，但求省点时间。</span></p>
<p><span style="font-family: Lucida Console; font-size: 12pt"><strong>对于gdal-1.7.3以后的版本，VS2005编译其实很简单。</strong></span></p>
<p><strong><span style="font-family: Lucida Console; font-size: 12pt">在GDAL目录下的nmake.opt文件中，找到大概第一百行多点的，原来是：</span><br /><span style="font-family: Lucida Console; font-size: 12pt">#WIN64=YES</span><br /><span style="font-family: Lucida Console; font-size: 12pt">修改为：</span><br /><span style="font-family: Lucida Console; font-size: 12pt">WIN64=YES</span><br /><span style="font-family: Lucida Console; font-size: 12pt">即如下：</span><br /><span style="font-family: Lucida Console; font-size: 12pt"># Uncomment the following if you are building for 64-bit windows</span><br /><span style="font-family: Lucida Console; font-size: 12pt"># (x64). You'll need to have PATH, INCLUDE and LIB set up for 64-bit</span><br /><span style="font-family: Lucida Console; font-size: 12pt"># compiles.</span><br /><span style="font-family: Lucida Console; font-size: 12pt">WIN64=YES</span></strong></p>
<p><span style="font-family: Lucida Console; font-size: 12pt"><strong>在新建x64平台时，必须选择复制Win32设置，如果你直接编译不行，可能需要安装vcredist_x86.exe(我安装</strong></span><span style="font-family: Lucida Console; font-size: 12pt"><strong>了，但不知这是否是决定因素)。</strong></span></p>
<p><strong><span style="font-family: Lucida Console; font-size: 12pt">当然，gdal-1.7.1编译需修改源代码中的错误，做点额外的步骤。</span><br /><span style="font-family: Lucida Console; font-size: 12pt">源文件&#8220;\gdal-1.7.1\frmts\leveller\levellerdataset.cpp&#8221;的第171行的内容如下： </span><br /><span style="font-family: Lucida Console; font-size: 12pt">{ "?, kPI / 180.0, UNITLABEL_DEGREE }, </span><br /><span style="font-family: Lucida Console; font-size: 12pt">在?号后面加上双引号"，改成如下形式： </span><br /><span style="font-family: Lucida Console; font-size: 12pt">{ "?", kPI / 180.0, UNITLABEL_DEGREE }, </span></strong></p>
<p><span style="font-family: Lucida Console; font-size: 12pt"><strong>默认的情况下，GDAL将会安装到"C:\warmerda\bld"文件夹内，可以改成自己习惯的目录，如可把GDAL_HOME修</strong></span><strong><span style="font-family: Lucida Console; font-size: 12pt">改成如下内容： </span><br /><span style="font-family: Lucida Console; font-size: 12pt">GDAL_HOME = "D:\gdal-runtime"</span></strong></p>
<p><strong><span style="font-family: Lucida Console; font-size: 12pt">makegdal80.sln编译后：配置属性-&gt;NMake-&gt;常规-&gt;"生成"命令行，修改</span><br /><span style="font-family: Lucida Console; font-size: 12pt">原来是：cd $(ProjectDir) &amp;&amp; nmake -f makefile.vc MSVC_VER=1400 DEBUG=1</span><br /><span style="font-family: Lucida Console; font-size: 12pt">修改为：cd $(ProjectDir) &amp;&amp; nmake -f makefile.vc MSVC_VER=1400 DEBUG=1 devinstall</span></strong></p>
<p><span style="font-family: Lucida Console; font-size: 12pt"><strong>确定之后，编译。之后会在gdal-runtime里面生成include、lib、bin等文件夹。</strong></span></p>
<p><span style="font-family: Lucida Console; font-size: 12pt"><strong>至</strong></span><span style="font-family: Lucida Console; font-size: 12pt"><strong>于其它更老的版本，我也是匆忙之间，懒得再去尝试了，欢迎其它人补充。</strong></span></p><br /><strong><span style="font-family: Lucida Console; font-size: 12pt">参考链接：</span><br /><span style="font-family: Lucida Console; font-size: 12pt">ms-help://MS.MSDNQTR.v80.chs/MS.MSDN.v80/MS.VisualStudio.v80.chs/dv_vccore/html/cb99f72b-8</span><span style="font-family: Lucida Console; font-size: 12pt">c74-48f4-846a-8921b37b97e9.h</span>tm<br />如何：针对 64 位平台配置 Visual C++ 项目<br /></strong>&nbsp; <img src ="http://www.cnitblog.com/longhulz/aggbug/76184.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/longhulz/" target="_blank">龙湖</a> 2011-10-24 17:07 <a href="http://www.cnitblog.com/longhulz/archive/2011/10/24/76184.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>