Arpit Khurana
Arpit Khurana

Reputation: 144

using c++11 with ndk

i am trying to use some dnn features from dlib in https://github.com/tzutalin/dlib-android but i am always getting errors like

error: no member named 'to_string' in
      namespace 'std'

and many more syntax errors

my application.mk file is like this

NDK_TOOLCHAIN_VERSION := clang
APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
APP_CPPFLAGS := -std=c++11 -frtti -fexceptions
APP_PLATFORM := android-8
APP_STL := gnustl_static
#APP_CFLAGS+=-DDLIB_NO_GUI_SUPPORT=on
#APP_CFLAGS+=-DDLIB_PNG_SUPPORT=off
APP_CFLAGS+=-DDLIB_JPEG_SUPPORT=on
APP_CFLAGS+=-DDLIB_JPEG_STATIC=on

According to me c++11 should be working ..I dont get where's the problem

Upvotes: 1

Views: 1664

Answers (1)

Dan Albert
Dan Albert

Reputation: 10509

This is https://github.com/android-ndk/ndk/issues/82

The fix for this is to switch from gnustl to libc++, but note that libc++ isn't as stable as gnustl is yet (working on fixing this ASAP, should be ready by the time r15 hits stable).

EDIT: As of NDK r16 libc++ is the recommended STL. Switch to using libc++ (see our docs) for full C++11 (and beyond) support.

Upvotes: 2

Related Questions