我在使用 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::string。存在一些 std::string 端口,我记得我找到了一两个,但最后我决定不使用 std::string。为什么?因为我们已经有了Java字符串和C字符串,Java字符串来自JNI调用,C字符串来自文件,如果再引入一种字符串类型,转化多于使用。
编辑:但请阅读下面的评论。
关于Android NDK r10: std::string 尚未声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28785347/