您的位置:首页 > 编程语言 > C语言/C++

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

2016-09-28 11:07 399 查看
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.



解决方法:

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


NDK_TOOLCHAIN_VERSION = 4.9

APP_CPPFLAGS := -frtti -std=c++11

<pre name="code" class="html">注意:NDK_TOOLCHAIN_VERSION 》= 4.7

重新ndk-build即可
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐