Reputation: 61
Currently I'm using NDK-r10c with C++11 support through gnustl. Unfortunately our project need to switch to stlport. While changing from gnustl to stlport many errors raised during compilation. Below is Application.mk file.
APP_PLATFORM := android-18
NDK_TOOLCHAIN_VERSION := 4.8
APP_ABI := armeabi-v7a
APP_STL := stlport_static
# APP_STL := gnustl_static
APP_CPPFLAGS := -std=c++11
ifeq ($(NDK_DEBUG),1)
APP_OPTIM := debug
else
APP_OPTIM := release
endif
It seems that C++11 features are not available: - cbegin(), cend() on vectors - data() on vectors, - cannot deduce auto from cbegin(), etc.
Upvotes: 1
Views: 2262
Reputation: 2113
STLport is just too old and does not support C++11 at all.
Flags like -std=c++11 will affect the compiler only, not necessarily the STL implementation.
You will have to use either gnustl or libc++
Upvotes: 3
Reputation: 3381
To use stlport you will need add these lines in your Android.mk
# Need this line to allow use alloc on stl containers
LOCAL_CFLAGS := -D_STLP_USE_NEWALLOC
# c++11 support
LOCAL_CPPFLAGS += -std=c++11
# for stl port
LOCAL_LDLIBS += -lstdc++
# include stl headers
LOCAL_C_INCLUDES += ${NDK_ROOT}/sources/cxx-stl/stlport/stlport
Upvotes: 0