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 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序
  • ¥15 onvif+openssl,vs2022编译openssl64
  • ¥15 iOS 自定义输入法-第三方输入法
  • ¥15 很想要一个很好的答案或提示
  • ¥15 扫描项目中发现AndroidOS.Agent、Android/SmsThief.LI!tr
  • ¥15 怀疑手机被监控,请问怎么解决和防止
  • ¥15 Qt下使用tcp获取数据的详细操作