@AK2806Kun wrote:
I added a member function to the Director named popSceneWithTransition to solve the problem of popScene with no transition.
When I using the method, the Xcode showed:
Undefined symbols for architecture x86_64: "void cocos2d::Director::popSceneWithTransition<cocos2d::TransitionFade>(float)", referenced from: CharacterSelectionScene::init()::$_0::operator()(cocos2d::Ref*, cocos2d::ui::Widget::TouchEventType) const in CharacterSelectionScene.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
The cocos2d_libs has none of errors.
Here is what I added to Director.
In CCDirector.h:
template <class Transition> void popSceneWithTransition(float time);
In cpp file:
template <class Transition> void Director::popSceneWithTransition(float time) { CCASSERT(_runningScene != nullptr, "running scene should not null"); _scenesStack.popBack(); ssize_t c = _scenesStack.size(); if (c == 0) { end(); } else { _sendCleanupToScene = true; _nextScene = Transition::create(time, _scenesStack.at(c - 1)); } }
How can I solve this?
Posts: 2
Participants: 1