Ubuntu用android-ndk-r15c编译boost_1_65_1

花门楼前见秋草,岂能贫贱相看老。这篇文章主要讲述Ubuntu用android-ndk-r15c编译boost_1_65_1相关的知识,希望能为你提供帮助。
解压:
unzip  android-ndk-r15c-linux-x86_64.zip
unzip boost_1_65_1.zip
cd boost_1_65_1/
./bootstrap.sh
vim tools/build/example/user-config.jam

import os ; if [ os.name ] = CYGWIN || [ os.name ] = NT { androidPlatform = windows-x86_64 ; } else if [ os.name ] = LINUX { androidPlatform = linux-x86_64 ; } else if [ os.name ] = MACOSX { androidPlatform = darwin-x86 ; }modules.poke : NO_BZIP2 : 1 ; ANDROID_NDK = /path/to/android-ndk-r15c ; using gcc : android4.9 : $(ANDROID_NDK)/toolchains/arm-linux-androideabi-4.9/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi-g++ : < archiver> $(ANDROID_NDK)/toolchains/arm-linux-androideabi-4.9/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi-ar < ranlib> $(ANDROID_NDK)/toolchains/arm-linux-androideabi-4.9/prebuilt/$(androidPlatform)/bin/arm-linux-androideabi-ranlib < compileflags> --sysroot=$(ANDROID_NDK)/platforms/android-9/arch-arm < compileflags> -I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/4.9/include < compileflags> -I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include< compileflags> -DNDEBUG < compileflags> -D__GLIBC__ < compileflags> -DBOOST_FILESYSTEM_VERSION=3 < compileflags> -lstdc++ < compileflags> -lgnustl_shared < compileflags> -mthumb < compileflags> -fno-strict-aliasing < compileflags> -std=gnu++11 < compileflags> -O2 ;

cp    tools/build/example/user-config.jam    tools/build/src/
./b2 --with-system --with-serialization toolset=gcc-android4.9 link=static runtime-link=static target-os=linux --stagedir=android
静态库就生成在
【Ubuntu用android-ndk-r15c编译boost_1_65_1】boost_1_65_1/android/lib文件夹下

    推荐阅读