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

Android NDK r10: std::string has not been declared

本文关键字:未声明 string std r10 Android NDK      更新时间:2023-10-16

我的android ndk r10有问题。我得到以下信息:std::string尚未声明。我看了其他论坛的帖子,但没有一个对我有帮助。我的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

请帮帮我!

类std::string尚未声明,因为它不存在。不幸的是,NDK中没有std::字符串。std::string的一些端口存在,我记得我找到了一两个,但最终我决定不使用std::字符串。为什么?因为我们已经有了Java字符串和C字符串,Java字符串来自JNI调用,C字符串来自文件,如果你再引入一种字符串类型,那将是更多的转换而不是使用。

编辑:但请阅读下面的评论。