cocos2d-x添加GLES-Render.h?GLES-Render.cpp?后错

cocos2d-x添加GLES-Render.h GLES-Render.cpp 后报 NSString

error: expected unqualified-id

@class NSString, Protocol;

^

Headers/NSObjCRuntime.h:411:19: error: unknown type name 'NSString'

FOUNDATION_EXPORT NSString *NSStringFromSelector(SEL aSelector);

^

error: use of undeclared identifier 'NSString'

FOUNDATION_EXPORT SEL NSSelectorFromString(NSString *aSelectorName);

^

error: use of undeclared identifier 'aSelectorName'

FOUNDATION_EXPORT SEL NSSelectorFromString(NSString *aSelectorName);

^

error: unknown type name 'NSString'

FOUNDATION_EXPORT NSString *NSStringFromClass(Class aClass);

^

error: use of undeclared identifier 'NSString'

FOUNDATION_EXPORT Class NSClassFromString(NSString *aClassName);

^

error: use of undeclared identifier 'aClassName'

FOUNDATION_EXPORT Class NSClassFromString(NSString *aClassName);

^

error: unknown type name 'NSString'

FOUNDATION_EXPORT NSString *NSStringFromProtocol(Protocol *proto) NS_AVAILABLE(10_5, 2_0);

^

error: use of undeclared identifier 'Protocol'

FOUNDATION_EXPORT NSString *NSStringFromProtocol(Protocol *proto) NS_AVAILABLE(10_5, 2_0);

I enhanced the same problems with you. Hope your sharing if you have resolve it.

NSString要在.mm文件中使用,不能在.cpp中。可以在cpp文件中调用一个temp.h。然后在temp.mm中调用NSString