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 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题