sky1989chen
2013-06-26 08:44
采纳率: 100%
浏览 7.0k

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

#ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__

#include "cocos2d.h"

#include "Box2D/Box2D.h"

#include "SimpleAudioEngine.h"

#include "GameObjHero.h"
#include "GameMark.h"

using namespace cocos2d;

class GameMain : 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();

    // a selector callback
    void menuCloseCallback(CCObject* pSender);

    bool isOver;
    CCSprite *bg1;
    CCSprite *bg2;
    GameObjHero *hero;
    CCArray *enemys;

    int blood;
    CCSprite *blood1;
    CCSprite *blood2;
    CCSprite *blood3;

    CCArray *bullets;
    CCArray *enemyBullets;

    GameMark *gameMark;

    CCSprite *gameOver;

    bool isReduce;

    virtual void update(float time);

    bool isCollion(CCPoint index, CCPoint point, int x, float y, int a, int b);

    void setHeroHurt();
    void setOver();

    void resetreduce(float d); 
    void releaseEnemyBullet(int x, int y);
    void releaseHeroBullet(int x, int y);

    // implement the "static node()" method manually
    CREATE_FUNC(GameMain);
};

#endif  // __HELLOWORLD_SCENE_H__

不知道怎么回事,求大神来看~
1>d:\mycplusplusproject\testprojectfour\classes\gamemain.h(30): error C2143: 语法错误 : 缺少“;”(在“*”的前面)
1>d:\mycplusplusproject\testprojectfour\classes\gamemain.h(30): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • rocksent8 2013-06-26 09:07
    已采纳

    int型未识别
    你可能少一个补丁
    VS90SP1-KB971092-X86

    打赏 评论

相关推荐 更多相似问题