ANDROID-GDAL 交叉编译
来源:互联网 发布:可信的淘宝货源 编辑:程序博客网 时间:2024/06/05 02:09
需要准备的东西:GDAL下载(我的是2.1.1) ANDROID-NDK-R10E 以及cygwin
1 打开cygwin终端在命令行,找到NDK下面build/tool/make-standalone-toolchain.sh文件
2 创建工具链 输入如下命令:
arm64: ./make-standalone-toolchain.sh --toolchain=aarch64-linux-android-4.9 arch=arm64 --platform=android-21
--system=windows-x86_64-ndk-dir=/cygwin/d/android/android-ndk-r10e --install-dir=/cygdrive/d/android/toolchain-21-arch64
----------------------------
armeabi-v7a: ./make-standalone-toolchain.sh --toolchain=arm-linux-androideabi-4.9 arch=arm --platform=android-15 --system=windows-x86_64 --install-dir=/cygdrive/d/android/android-toolchain-15-armv7 --ndk-dir=//cygdrive/d/android/android-ndk-r10e
3 创建工具链之后将创建的工具链的路径加入PATH环境变量如:/cygdrive/d/android/android-toolchain-21-armv7/bin加入到系统环境变量
4 执行configure(注意输出里面的文字内容,里面有个是否是交叉编译的信息输出[checking whether we are cross compiling... yes] 如果是YES 说明是正确的,否则就要小心了,编译处理来的就有问题)arm64下面的configureLIBS="-lstdc++"./configure--prefix=d:/android/pp--with-threads--with-ogr --host=aarch64-linux-android --without-geos--with-libz=internal -without-libtool -with-oci=no--with-xerces=no --with-expat=no --with-libkml=no --without-jpeg12 --without-bsb --without-grib --without-openfilegdb --without--filegdb --without-pam --without-pdf --without-sentinel2 --without-ctg --without-kmlsuperoverlay--without-wcs --without-vdv --without-dgn --without-dwg
armeabi-v7a下面的configure
CFLAGS="-mthumb" CXXFLAGS="-mthumb" LIBS="-lstdc++" ./configure --prefix=d:/android/pp1 --with-threads --with-ogr --host=arm-linux-androideabi --without-geos --with-libz=internal -without-libtool -with-oci=no --with-xerces=no --with-expat=no --with-libkml=no --without-jpeg12 --without-bsb --without-grib --without-openfilegdb --without--filegdb --without-pam --without-pdf --without-sentinel2 --without-ctg --without-kmlsuperoverlay --without-wcs --without-vdv --without-dgn --without-dwg
---------------------------------------------
5 make
执行MAKE之后可能会出现找不到cpl_port.h头文件找不到问题,这个是由于使用的路径是linux下面的路径,将Gdal根目录下面的GDALmake.opt中增加一个GDAL_ROOT_PATH的路径,
里面有头文件包含的地方以及动态连接库的地方(可以在编译出错的时候改)都用GDAL_ROOT_PATH这个代替GDAL_ROOT
其中GDAL_ROOT_PATH这个是windows下面的路径(路径是反斜杠的)。
有些时候会出现Error : *** target pattern contains no `%' 这个问题是因为CYGWIN的版本有问题,将cygwin/bin下面的make文件改成make.exe改成3.8版本的(具体可以在网上找这个文件,主要原始是不识别路径中的“:”)
执行完成之后 生成的静态库大概是170M
执行完成之后 生成的静态库大概是170M
make install
阅读全文
1 0
- ANDROID-GDAL 交叉编译
- GDAL for Android在linux下交叉编译的问题
- android NDK 交叉编译
- android NDK 交叉编译
- android 交叉编译命令行
- android 交叉编译 flac
- Android 交叉编译
- android NDK 交叉编译
- Android NDK 交叉编译
- android NDK 交叉编译
- android NDK 交叉编译
- android NDK 交叉编译
- Android交叉编译libiconv
- Android 交叉编译 libmicrohttpd
- Android NDK 交叉编译
- Android 交叉编译
- GDAL 编译
- GDAL编译
- linux中内存泄漏的检测(二)定制化的malloc/free
- 【HNOI2015】菜肴制作 :思想 + 拓扑排序
- POJ 1873 The Fortified Forest(凸包)
- linux中内存泄漏的检测(三)定制化的new/delete
- Rebuilding Roads POJ
- ANDROID-GDAL 交叉编译
- iOS 使用信号量来处理多图片上传
- CSS-如何让img图片元素居中
- 从AtomicXXX稍微说一下Unsafe
- 苹果手机的z-index 无效的问题
- 程序
- Error opening file: /sdcard/screenshot.png (Read-only file system) 问题解决
- linux中内存泄漏的检测(四)记录泄漏的大小
- 那些年我犯过的错