我在helloworld中的pulic:加了个
public:
static Vector<Sprite*> all_sprite;
然后在
bool HelloWorld::init() {
…
all_sprite.pushBack(mysprite);
addchild(mysprite);
}
编译的时候报了这个错
Undefined symbols for architecture x86_64:
“HelloWorld::all_sprite”, referenced from:
HelloWorld::init() in HelloWorldScene.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我选的target 是mac os
