明明在类中定义了成员,为什么找不到标识符?

类定义如下:

class HelloWorld : public cocos2d::Layer
{
private:

Sprite *beijing;
Sprite *cangshu;
Sprite *guazi1;

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

// 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);


//菜单
void Menutest(Ref *ref);

};

在init中的调用:

bool HelloWorld::init()
{
//前边是初始化的语句,下边是创建精灵的语句 ........
// add "HelloWorld" splash screen"
beijing = Sprite::create("beijing.jpg"); //这里开始提示找不到标识符
cangshu = Sprite::create("cangshu.png");
guazi1 = Sprite::create("guazi1.png");
setTouchEnabled(true);

// position the sprite on the center of the screen
beijing->setPosition(Vec2(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y));
beijing->setScale(2.2);
cangshu->setPosition(Vec2(visibleSize.width / 2 + origin.x, visibleSize.height / 2 + origin.y));
guazi1->setPosition(Vec2(visibleSize.width / 2 + origin.x , visibleSize.height / 2 + origin.y ));

// add the sprite as a child to this layer
this->addChild(beijing, 0 , beijing_tag);
this->addChild(cangshu, 1 , cangshu_tag);
this->addChild(guazi1, 2 , guazi1_tag);

因为作业射击游戏刚接触Cocos 2d-x的小白一枚。。。
如图,明明在类中定义了成员变量,但是在init函数里调用的时候却说找不到标识符??为什么呢?之前还尝试过把Sprite定义为全局变量,但是这样编译通过,调试报错,那么到底怎样才能定义一个到处都可以用的Sprite变量呢

图看不到哦,没有办法。
你需要将图上传到 CSDN,再在这里使用。

命名空间USING_NS_CC;加了没
射击游戏可以看这里
http://blog.csdn.net/evankaka/article/category/2922463

Sprite在哪里定义的,我的确没看到。
看起来这是一个类和它的静态函数,怎么是变量呢。

只看到你的Sprite来定义其他变量,没有看Sprite 被定义