GDAL1.6的編譯

來源:互聯網
上載者:User
 

1、下載原始碼。
         1)  下載GDAL1.6,解壓到C:/gdal-1.6.0。(http://trac.osgeo.org/gdal/wiki/DownloadSource)
     2) 下載Geos3.0.0,(http://trac.osgeo.org/geos/)
     3) 下載swigwin-1.3.36,解壓到 C:/gdal-1.6.0/swigwin-1.3.36。 (http://sourceforge.net/project/showfiles.php?group_id=1645)
     4) 下載Proj4.6.1 (http://trac.osgeo.org/proj/)

2、編譯GEOS。(http://mateusz.loskot.net/2007/11/26/geos-300rc4-and-visual-c/)

3、編譯Proj。
     1) C:/Program Files/Microsoft Visual Studio 8/VC>vcvars32.bat 
       2)nmake /f makefile.vc all

4、修改GDAL的nmake.opt中如下幾處:

!IFNDEF MSVC_VER
#assume msvc 7.1
MSVC_VER=1400
!ENDIF
-------------------------------------------
!IFNDEF GDAL_HOME
GDAL_HOME = "C:/gdal-1.6.0"
!ENDIF
-------------------------------------------
# Set the location of your SWIG installation
!IFNDEF SWIG
SWIG = C:/gdal-1.6.0/swigwin-1.3.36/swig.exe
!ENDIF
-------------------------------------------
# Uncomment for GEOS support
GEOS_DIR=C:/gdal-1.6.0/Geos3.0.0
GEOS_CFLAGS = -I$(GEOS_DIR)/capi -I$(GEOS_DIR)/source/headers -DHAVE_GEOS
GEOS_LIB     = $(GEOS_DIR)/source/geos_c_i.lib
-------------------------------------------
另外:有兩個源檔案,由於中西文編碼的問題會導致編譯錯誤(frmts/leveller/levellerdataset.cpp和frmts/rmf/rmfdataset.cpp)。
解決方案:在vs中開啟檔案,然後再用ie開啟檔案,將ie的編碼改成西歐,將網頁中的代碼複製到vs中儲存,就行了。

5、編譯GDAL

      1) C:/Program Files/Microsoft Visual Studio 8/VC>vcvars32.bat 
      2) nmake /f makefile.vc
      3) nmake /f makefile.vc install
      4) namke /f makefile.vc devinstall

6、將根目錄中產生的gdal16.dll 拷貝到目錄pymod和swip/csharp中。編譯swip,產生gdal-wrap

     1) 轉到swip/csharp目錄 執行: nmake /f makefile.vc interface 
     2). nmake /f makefile.vc

7、C#庫包括:
     gdal16.dll、gdal_csharp.dll、ogr_csharp.dll、osr_csharp.dll、gdalconst_csharp.dll、gdal_wrap.dll、ogr_wrap.dll、osr_wrap.dll、gdalconst_wrap.dll

 、proj.dll、geos_c.dll

 

     1)下載: geos-3.0.0.rc4-makefile-fix.zip
     2)nmake /f makefile.vc MSVC_VER=1400

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.