开发者

Boost C++ and Android 3

I tr开发者_如何学运维ied 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? I am especially interested in smart_ptr, threads, function, lexical_cast, string_algo and containers. Any input is appreciated. Thank you.


Have a look at this project: 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.

To compile Boost for Android you may use the customized NDK r4b provided by Dmitry Moskalchuk aka CrystaX. Or you may download official NDK r5c.

Since it was written NDK r6 have been released by Google (and customized by CrystaX). Thus I suggest you to build "Boost for Android" against the latest NDK r6 from CrystaX, as described on its site:


./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.

Now that you got boost compiled you must add it to your Android.mk file. First copy the the include and lib folder over to your jni folder. I copied it just into: /jni/boost/.

Add the following to your 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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜