【Android】Error:(32, 2) error: #error ....support for the ISO C++...


Error:(32, 2) error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

【Android】Error:(32, 2) error: #error ....support for the ISO C++..._第1张图片


解决方法:

nullptr是C++11引入的新特性,解决C和C++中NULL的定义不一致所带来的编译器兼容问题。C中NULL是指向0地址的指针(void *)0,c++中则是定义为整数0.

ndk中解决这个问题的办法就是添加对C++11的支持,在Application.mk中添加:

NDK_TOOLCHAIN_VERSION = 4.9
APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -fexceptions -std=c++11
APP_ABI := armeabi armeabi-v7a
APP_PLATFORM := android-8

  1. NDK_TOOLCHAIN_VERSION = 4.9  
  2. APP_CPPFLAGS := -frtti -std=c++11  
  3.   
  4. <pre name="code" class="html">注意:NDK_TOOLCHAIN_VERSION 》= 4.7  
  5. 重新ndk-build即可



你可能感兴趣的:(Android)