sky1989chen 2013-06-26 08:44 采纳率: 100%
浏览 7061
已采纳

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘