为什么不能在HelloWorld.h内申明Sprite 和 Image

在HelloWorld.h内直接申明变量为什么不能申明 Sprite 和 Image
class HelloWorld : public cocos2d::Layer
{
public:

Sprite* spr;
// 以上写法会报错
//错误 4 error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int (…\Classes\HelloWorldScene.cpp) d:\work\cocospj\gamename\classes\helloworldscene.h 24 1 gamename
//错误 2 error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int (…\Classes\AppDelegate.cpp) d:\work\cocospj\gamename\classes\helloworldscene.h 24 1 gamename
//错误 3 error C2143: 语法错误 : 缺少“;”(在“”的前面) (…\Classes\HelloWorldScene.cpp) d:\work\cocospj\gamename\classes\helloworldscene.h 24 1 gamename
//错误 1 error C2143: 语法错误 : 缺少“;”(在“
”的前面) (…\Classes\AppDelegate.cpp) d:\work\cocospj\gamename\classes\helloworldscene.h 24 1 gamename

// there's no 'id' in cpp, so we recommend returning the class instance pointer
static cocos2d::Scene* createScene();

GameMainWin32* gameMain;
// Here’s a difference. Method ‘init’ in cocos2d-x returns bool, instead of returning ‘id’ in cocos2d-iphone
virtual bool init();

// a selector callback
void menuCloseCallback(cocos2d::Ref* pSender);

// implement the "static create()" method manually
CREATE_FUNC(HelloWorld);

virtual void update(float delta);

}

命名空间没加吧 using namespace cocos2d;

楼上正解1010101010

public那继承Layer有加cocos2d::,Sprite怎么就不加呢。。。

感谢解答,就是这个原因