NDK 构建错误:命名空间'std'中的'string'未命名类型

ndk-build error: 'string' in namespace 'std' does not name a type

本文关键字:中的 string 未命名 类型 std 构建 命名空间 错误 NDK      更新时间:2023-10-16

我对ndk构建(ndk-r9c(有问题

错误:

Common/LCXPlayerSocket.h:206:2: error: 'string' in namespace 'std' does not name a type

信息:

我的应用程序.mk

APP_MODULES         := MyLib
APP_OPTIM           := $(COMPTYPE)
APP_ABI             := $(TYPE_ARMEABI)
APP_PLATFORM        := $(PLATFORM)
APP_STL             := $(STL_VERSION)

我的配置.bat

set TYPE_ARMEABI=armeabi-v7a
set PLATFORM=android-8
set STL_VERSION=stlport_static //does not working on <gnustl_static>

Src文件:

include <string.h>
class abc
{
protected:
 std::string m_buffer; //line 206
}

错误已被解决:

thx@紫罗兰长颈鹿

@ndtran:从.bat中删除集合STL_VERSION。将其添加到Application.mk:APP_STL:=gnustl_static–Violet Giraffe 6分钟前

谢谢你的帮助。[D]

include <string> 替换include <string.h>