各位大大,在根据社区中的Flappy Bird教程写出来的demo中,在run时总是提示如下:
Undefined symbols for architecture armv7:
“GameLayer::gameOver()”, referenced from:
GameLayer::onContactBegin(cocos2d::PhysicsContact&) in GameLayer.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
代码如下:
auto contactListener = EventListenerPhysicsContact::create();
contactListener->onContactBegin = CC_CALLBACK_1(GameLayer::onContactBegin, this);
this->getEventDispatcher()->addEventListenerWithSceneGraphPriority(contactListener, this);
bool GameLayer::onContactBegin(PhysicsContact& contact) {
this->gameOver();
return true;
}
引擎是3.5版本的,不知道如何解决