简体   繁体   English

Android NDK r10:std :: string尚未声明

[英]Android NDK r10: std::string has not been declared

I'm having problems with the android ndk r10. 我在使用android ndk r10时遇到问题。 I get the following: std::string has not been declared. 我得到以下信息:std :: string尚未声明。 I watched other forum threads like this, but nope of them helped me. 我看了其他类似这样的论坛话题,但没有一个对我有帮助。 My Application.mk looks like this: 我的Application.mk看起来像这样:

    APP_PLATFORM := android-14
APP_ABI := armeabi-v7a # build for the ARM version of MCPE
APP_CFLAGS := -O2 -std=gnu99 # optimization level 2, use C99 (for decleations in for loops, etc)

APP_CPPFLAGS := -std=c++11
LOCAL_CFLAGS := -std=c++11
APP_STL := stlport_static

Please help me! 请帮我!

The class std::string has not been declared because it's not there. 由于尚未声明std :: string类,因此尚未声明。 Unfortunately, there is no std::string in NDK. 不幸的是,NDK中没有std :: string。 Some ports of std::string exist, I remember I found one or two, but finally I decided just not to use std::string. 存在std :: string的某些端口,我记得我发现了一个或两个端口,但最终我决定不使用std :: string。 Why? 为什么? Because we already have Java strings and C strings, Java strings come from JNI calls, C strings come from files, and if you introduce one more string type, it will be more conversion than usage. 因为我们已经有Java字符串和C字符串,所以Java字符串来自JNI调用,C字符串来自文件,如果再引入一种字符串类型,那么转换将比用法更多。

EDIT: but read the comment below. 编辑:但是请阅读下面的评论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM