Objective-C を数年間使用した後、C++ と Cocos2d-x を学び始めたところです。今夜の障害は、CCArray 関数をクラス全体の変数として使用する方法を学習することのようです。
HelloWorldScene.h
class HelloWorld : 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);
// implement the "static node()" method manually
CREATE_FUNC(HelloWorld);
// static Array of tiles
static cocos2d::CCArray* uniquetiles;
};
HelloWorldScene.cpp
uniquetiles=CCArray::create();
uniquetiles->addObject(d00);
コードを実行しようとすると、「'Helloworld::uniquetiles' への未定義の参照です」というエラーが表示されます
ここで何が間違っていますか?これは簡単なようです。