std::to_string is not memember of std android
16lz
2021-12-04
cmake 构建就没这个问题
c++库的问题
- (https://developer.android.com/ndk/guides/cpp-support?hl=zh-cn)
- 使用NDK-BUILD 直接构建:
AAtransMBP:android lijin$ /Users/lijin/Library/Android/sdk/ndk-bundle/ndk-build Android NDK: WARNING: APP_STL gnustl_static is deprecated and will be removed in the next release. Please switch to either c++_static or c++_shared. See https://developer.android.com/ndk/guides/cpp-support.html for more information.
双重保险
- Application.mk 里
APP_STL := c++_staticAPP_CPPFLAGS := -frtti -fexceptions -std=c++11APP_ABI := armeabi-v7aAPP_PLATFORM := android-21
- gralde 里
ndk { moduleName "ccsdk" abiFilter "armeabi-v7a" stl "c++_static" ldLibs "log" }
如果怕有风险
#include #include #if defined(__ANDROID__)#define TO_STRING to_stringAndroidtemplate <typename T>inline std::string to_stringAndroid(T value){ std::ostringstream os ; os << value ; return os.str() ;}#else#define TO_STRING std::to_string#endif
更多相关文章
- mybatisplus的坑 insert标签insert into select无参数问题的解决
- 箭头函数的基础使用
- NPM 和webpack 的基础使用
- Python list sort方法的具体使用
- 【阿里云镜像】使用阿里巴巴DNS镜像源——DNS配置教程
- Android运行报错:Error: Static interface methods are only supp
- Android系统工具之Roblectric 使用过程中问题总结
- Android(安卓)自定义View measure模板
- 2013.03.19(3)———android ActivityGroup的一些问题