How to enable the "C ++ 0X" experimental standard when compiling .cpp files in Android-ndk (r7)?

Studying the header file android-ndk-linux_x86 / sources / cxx-stl / gnu-libstdC ++ / include / memory, I believe that this header contains other STL header files according to

__GXX_EXPERIMENTAL_CXX0X__ 

flag. I think this flag refers to the "C ++ 0X" standard, and this standard may still be experimental in Android-ndk r7. However, I want to include this C ++ standard in my project. (I'm not sure if this C ++ 0X standard was enabled by default)

I want to know how to tell Android-ndk to set this flag when I compile .cpp files in the "project / jni" directory of an Android project. Or how can I include the experimental C ++ 0X standard in my application.

Whether the flag should be specified using, for example, LOCAL_CPPFLAGS and / or APP_CPPFLAGS, in the file "Android.mk" / "Application.mk". (I use "APP_STL: = gnustl_static" in my "Application.mk")

Thanks for any suggestion.

Lawrence Tsang

+6
source share
1 answer

C ++ 03 is not an experimental standard; this is the default value.

C ++ 0X, however, is an experimental standard. Its official name is now installed as C ++ 11, but the implementation is not complete in GCC (and everywhere). You can enable it by passing --std=c++0x to GCC. Remember to check the function status page before complaining that something is broken.

+7
source

Source: https://habr.com/ru/post/906070/


All Articles