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? 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With