Enable C++11 support on Android

It appears the main answer here includes experimental support for C++11, and C++11 is not experimental anymore.

If you’re using command line NDK support (I use IDEA community edition 13 for the Java stuff), then this is what I had to put in my jni/Application.mk to get C++11 support with API 19 (on OSX ML):

NDK_TOOLCHAIN_VERSION := 4.8
# APP_STL := stlport_shared  --> does not seem to contain C++11 features
APP_STL := gnustl_shared

# Enable c++11 extentions in source code
APP_CPPFLAGS += -std=c++11

Derived from here and here.

Leave a Comment