2 sky1989chen sky1989chen 于 2013.06.26 16:44 提问

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个回答

u011196049
u011196049   2013.06.26 17:07
已采纳

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

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!