8,305
社区成员
发帖
与我相关
我的任务
分享
#ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__
#include "cocos2d.h"
using namespace std;
USING_NS_CC;
//USING_NS_CC_EXT;
class NewScene :public cocos2d::CCLayer
{
public:
NewScene(void);
~NewScene(void);
static CCScene* scene();
CREATE_FUNC(NewScene);
virtual bool init();
void changeScene(CCObject * sender);
};
#endif // __HELLOWORLD_SCENE_H__
[/quote]
估计是你文件路径不对了,你是把cpp文件放在哪了?[/quote]
Classes文件夹和proj.win32里面都放了,.h和.cpp放在一起的[/quote]
是这行代码的问题
#ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__
删掉就好了。。。我直接抄了整个helloworld.h....[/quote]
这个。。不要删,你改一下,改成你的类的名字,只要唯一就好了~#ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__
#include "cocos2d.h"
using namespace std;
USING_NS_CC;
//USING_NS_CC_EXT;
class NewScene :public cocos2d::CCLayer
{
public:
NewScene(void);
~NewScene(void);
static CCScene* scene();
CREATE_FUNC(NewScene);
virtual bool init();
void changeScene(CCObject * sender);
};
#endif // __HELLOWORLD_SCENE_H__
[/quote]
估计是你文件路径不对了,你是把cpp文件放在哪了?[/quote]
Classes文件夹和proj.win32里面都放了,.h和.cpp放在一起的[/quote]
是这行代码的问题
#ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__
删掉就好了。。。我直接抄了整个helloworld.h....#ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__
#include "cocos2d.h"
using namespace std;
USING_NS_CC;
//USING_NS_CC_EXT;
class NewScene :public cocos2d::CCLayer
{
public:
NewScene(void);
~NewScene(void);
static CCScene* scene();
CREATE_FUNC(NewScene);
virtual bool init();
void changeScene(CCObject * sender);
};
#endif // __HELLOWORLD_SCENE_H__
[/quote]
估计是你文件路径不对了,你是把cpp文件放在哪了?[/quote]
Classes文件夹和proj.win32里面都放了,.h和.cpp放在一起的#ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__
#include "cocos2d.h"
using namespace std;
USING_NS_CC;
//USING_NS_CC_EXT;
class NewScene :public cocos2d::CCLayer
{
public:
NewScene(void);
~NewScene(void);
static CCScene* scene();
CREATE_FUNC(NewScene);
virtual bool init();
void changeScene(CCObject * sender);
};
#endif // __HELLOWORLD_SCENE_H__
#ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__
#include "cocos2d.h"
using namespace std;
USING_NS_CC;
//USING_NS_CC_EXT;
class NewScene :public cocos2d::CCLayer
{
public:
NewScene(void);
~NewScene(void);
static CCScene* scene();
CREATE_FUNC(NewScene);
virtual bool init();
void changeScene(CCObject * sender);
};
#endif // __HELLOWORLD_SCENE_H__
[/quote]
估计是你文件路径不对了,你是把cpp文件放在哪了?