Hi everyone, I’m using Android studio 1.3.2 and am trying to build a project using native code and C ++ 11 features (share_ptr, weak_ptr and etc.), but I get errors. For example:
Error: (22, 6) error: 'shared_ptr' in namespace 'std' does not name a template type
I asked the question here , but so far without an answer.
The problem: How to use C ++ 11 and Android Studio + NDK?
ps I tried to add the cppFlags.add ("-std=c++11") flag cppFlags.add ("-std=c++11") to the project file "build.gradle"
android.ndk { moduleName = "game" cppFlags.addAll(["-I${file("src/main/jni/native_app_glue")}".toString(), "-I${file("src/main/jni")}".toString(), "-I${file("src/main/jni/data")}".toString()]) cppFlags.add ("-std=c++11") ldLibs.addAll(["android", "EGL", "GLESv2", "OpenSLES", "log"]) stl = "stlport_static" } but it doesn't seem to work.