GDAL for Android編譯

一、若是已有請忽略,下載安裝虛擬機,共享一下百度雲,不要在去找祕鑰了html

連接:http://pan.baidu.com/s/1qYVxtiG 密碼:020alinux

二、若是已有請忽略,開啓BIOS的CPU的虛擬化支持,自行百度android

三、若是已有請忽略,設置共享文件夾c++

參考文檔:http://blog.csdn.net/u010297957/article/details/51417171git

上述操做均在主機上操做,本人用的是win10github

四、若是已有請忽略,下載ndk 與gdalwindows

下載完成後自行解壓,建議在linux環境中下載解壓,由於後續的操做將linux中操做,被windows操做的文件你沒法想象會產生什麼意想不到的問題centos

ndk:bash

https://developer.android.google.cn/ndk/downloads/index.htmlide

wget http://dl.google.com/android/repository/android-ndk-r14b-linux-x86_64.zip

zip android-ndk-r14b-linux-x86_64.zip

很奇怪的意見事情,解壓過程當中提示文件名衝突,我也不知道什麼會有這樣的事情。有知道的請告知一番。

gdal:

svn:http://svn.osgeo.org/gdal/trunk

git:

https://github.com/OSGeo/gdal.git

後續內容參考

參考一:http://trac.osgeo.org/gdal/wiki/BuildingForAndroid

參考二:https://github.com/nutiteq/gdal/wiki/AndroidHowto

問:既然人家有了,你爲甚還要從新作一遍 ?

答:由於每一個人水平不同,沒有一個教程適合全部的人

 五、建立toolchain

在centos中操做

#官方教程爲
~$ android-ndk-r5b/build/tools/make-standalone-toolchain.sh --platform=android-8 --install-dir=android-8-toolchain
#增長參數,增長 --verbose android版本調整到最小9,安裝目錄自行設置
~$ android-ndk-r5b/build/tools/make-standalone-toolchain.sh --verbose --platform=android-9 --install-dir=android-9-toolchain

增長參數後就能夠知道若是發生錯誤的提示內容了。修改事後提示成功以下圖:

六、設置環境變量

七、配置相應的參數

切換到gdal的目錄下而後執行以下命令:

關於without 和with參數根據本身的須要配置,關於輸出結果路徑自行配置

CFLAGS="-mthumb" CXXFLAGS="-mthumb" LIBS="-lsupc++ -lstdc++"  ./configure --host=arm-linux-androideabi --prefix=/mnt/hgfs/ShareVM/gdal --without-gif --with-threads --with-ogr  --with-geos --with-libz=internal

而後就死活編譯不下去了:

日誌問題以下

終端提示以下:

日誌文件附件以下

連接地址:https://pan.baidu.com/s/1pLypz1h

有知道歡迎告知一二!

相關文章
相關標籤/搜索