日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Android >内容正文

Android

ubuntu16.04编译boost for Android(boost 1.65)

發(fā)布時間:2023/12/1 Android 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ubuntu16.04编译boost for Android(boost 1.65) 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
下載boost源碼

在官網(wǎng)下載指定版本的源碼
http://www.boost.org/users/history/

編譯boost源碼

1.進入源碼目錄執(zhí)行./bootstrap.sh生成編譯工具

2.編輯project-config.jam文件,替換如下內(nèi)容

# define platform name of ndk 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 ; }# replace with your own ndk path.eg:/usr/ndk/android-ndk-r12b ANDROID_NDK = "/path/to/your/dnk" ;# compile with gcc, you can change compiler to clang or others 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>-I$(ANDROID_NDK)/platforms/android-21/arch-arm/usr/include <compileflags>-I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/4.9/include <compileflags>-I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/4.9/include/backward <compileflags>-I$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include <compileflags>-fexceptions <compileflags>-frtti <compileflags>-fpic <compileflags>-ffunction-sections <compileflags>-funwind-tables <compileflags>-D__ARM_ARCH_5__ <compileflags>-D__ARM_ARCH_5T__ <compileflags>-D__ARM_ARCH_5E__ <compileflags>-D__ARM_ARCH_5TE__ <compileflags>-D__ARM_ARCH_7__ <compileflags>-D__ARM_ARCH_7A__ <compileflags>-Wno-psabi <compileflags>-march=armv7-a <compileflags>-mtune=xscale <compileflags>-mfloat-abi=softfp <compileflags>-marm <compileflags>-mthumb <compileflags>-Os <compileflags>-std=gnu++11 <compileflags>-fomit-frame-pointer <compileflags>-fno-strict-aliasing <compileflags>-finline-limit=64 <compileflags>-Wa,--noexecstack <compileflags>-DANDROID <compileflags>-D__ANDROID__ <compileflags>-D__ARM_EABI__ <compileflags>-DNDEBUG <compileflags>-O2 <compileflags>-g ;# project default compiler project : default-build <toolset>gcc-android4.9 ;# replace with libraries you wanna to build libraries = --with-container --with-coroutine --with-fiber --with-graph --with-graph_parallel --with-log --with-metaparse --with-python --with-test --with-type_erasure --with-atomic --with-date_time --with-program_options --with-chrono --with-context --with-iostreams --with-locale --with-mpi --with-serialization --with-signals --with-timer --with-wave --with-math --with-random --with-exception --with-filesystem --with-thread --with-system --with-regex --with-program_options

3、執(zhí)行以下命令
./b2 toolset=gcc-android4.9 link=static threading=multi target-os=linux --stagedir=android_build
toolset表示指定編譯工具,link表示編譯成靜態(tài)庫,threading表示使用多線程編譯,–stagedir表示指定編譯文件生成目錄名
4、將編譯好的boost庫放到指定文件夾下便于引用
sudo ./b2 install --prefix=/your/path/to/install
eg:
sudo ./b2 install --prefix=/usr/boost/android_boost
這樣在使用的時候,可以將該路徑加入到你的代碼中去查找相關(guān)的庫等。

參考:https://github.com/teamarkstudio/boost_for_android

總結(jié)

以上是生活随笔為你收集整理的ubuntu16.04编译boost for Android(boost 1.65)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。