Porting a library that requires RTTI, exception, and STL support
The Android platform provides a C++ runtime library at /system/lib/libstdc++.so
. This default runtime library does not provide C++ exception and RTTI. The support for a standard C++ library is also limited. Fortunately,
Android NDK provides alternatives to the default C++ runtime library, which makes porting of a large number of existing libraries that require exception, RTTI, and STL support, possible. This recipe discusses how to port a C++ library that requires RTTI, exception, and STL support. You will widely use the boost
library as an example.
How to do it...
The following steps describe how to build and use the boost
library
for Android NDK:
Install a customized Android toolchain with the following command:
$ANDROID_NDK/build/tools/make-standalone-toolchain.sh --platform=android-9 --install-dir=/tmp/my-android-toolchain
This should install the toolchain at the
/tmp/my-android-toolchain
folder.Create an Android application...