error C2143: 语法错误 : 缺少“;”(在“using”的前面)

时间:2023-03-10 00:18:58
error C2143: 语法错误 : 缺少“;”(在“using”的前面)
class JJMenuScene : public cocos2d::CCLayer
{
public:
// Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
virtual bool init(); // there's no 'id' in cpp, so we recommand to return the exactly class pointer
static cocos2d::CCScene* scene();
}

之前的C++自从开发android以后,都差不多丢光了,今天遇到一个问题,就是C2143,把基础的也忘记了,该再去补一下基础的内容了。

需要在类后面添加一个冒号;

class JJMenuScene : public cocos2d::CCLayer
{
public:
// Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
virtual bool init(); // there's no 'id' in cpp, so we recommand to return the exactly class pointer
static cocos2d::CCScene* scene();
};