Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c++

android

stl

I have a problem with ndk-build (ndk-r9c)

Error:

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

Info:

My Application.mk

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

My config.bat

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

Src file:

include <string.h>

class abc

{

protected:

 std::string m_buffer; //line 206

}

The bug was resold:

thx @Violet Giraffe

@ndtran: remove set STL_VERSION from your .bat. Add this to Application.mk: APP_STL := gnustl_static – Violet Giraffe 6 mins ago

Thx for your help. [D]

like image 937
ndtran Avatar asked Mar 16 '26 16:03

ndtran


1 Answers

Replace include <string.h> with include <string>

like image 91
Violet Giraffe Avatar answered Mar 18 '26 08:03

Violet Giraffe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!