简体   繁体   English

Boost C ++和Android 3

[英]Boost C++ and Android 3

I tried to google and SO search. 我试图谷歌搜索。 So far I was able to find only conflicting information. 到目前为止,我只能找到有冲突的信息。 If it is too hard to marry Boost and Android, maybe there are replacements? 如果很难将Boost和Android结合使用,也许有替代产品吗? I am especially interested in smart_ptr, threads, function, lexical_cast, string_algo and containers. 我对smart_ptr,线程,函数,lexical_cast,string_algo和容器特别感兴趣。 Any input is appreciated. 任何输入表示赞赏。 Thank you. 谢谢。

Have a look at this project: https://github.com/MysticTreeGames/Boost-for-Android 看看这个项目: https : //github.com/MysticTreeGames/Boost-for-Android

Boost for android is a set of tools to compile the main part of the Boost C++ Libraries for the Android platform. Boost for Android是用于为Android平台编译Boost C ++库主要部分的一组工具。

To compile Boost for Android you may use the customized NDK r4b provided by Dmitry Moskalchuk aka CrystaX . 要编译Android版Boost,可以使用Dmitry Moskalchuk或 CrystaX提供的自定义NDK r4b Or you may download official NDK r5c . 或者,您可以下载官方的NDK r5c

Since it was written NDK r6 have been released by Google (and customized by CrystaX). 自编写以来,NDK r6已由Google发布(并由CrystaX定制)。 Thus I suggest you to build "Boost for Android" against the latest NDK r6 from CrystaX, as described on its site: 因此,我建议您针对CrystaX的最新NDK r6构建“ Boost for Android”,如其网站所述:


./build-android.sh crystax/ndk/root

This command will download and build boost against the Crystax NDK and output the final header and libs and in the build folder. 该命令将针对Crystax NDK下载并构建boost,并在build文件夹中输出最终的标头和库。

Now that you got boost compiled you must add it to your Android.mk file. 现在,您已经编译了Boost,必须将其添加到Android.mk文件中。 First copy the the include and lib folder over to your jni folder. 首先将includelib文件夹复制到jni文件夹中。 I copied it just into: /jni/boost/ . 我将其复制到: /jni/boost/

Add the following to your Android.mk : 将以下内容添加到您的Android.mk

LOCAL_CFLAGS += -I$(LOCAL_PATH)/boost/include/ 
LOCAL_LDLIBS += -L$(LOCAL_PATH)/external/boost/lib/ -lboost_system -lboost_...

LOCAL_CPPFLAGS += -fexceptions
LOCAL_CPPFLAGS += -frtti

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM