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();
};

 

posted on 2013-08-21 15:41  yuan19  阅读(596)  评论(0编辑  收藏  举报

导航