【Android】Error:(32, 2) error: #error ....support for the ISO C++...
16lz
2022-04-01
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.9APP_STL := gnustl_staticAPP_CPPFLAGS := -frtti -fexceptions -std=c++11APP_ABI := armeabi armeabi-v7aAPP_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即可
更多相关文章
- Android(安卓)自定义日历控件
- andorid 自定义seekbar
- Flutter 打包 Could not get resource
- Android(安卓)自定义显示图片Dialog
- android 时间戳与日期格式的互相转换 以及 自定义选择器
- Android(安卓)官方数据库Room --- 配置
- Android(安卓)自定义View (一)
- android 显示 网络图片
- android 源码的一些修改定制方案