Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17103

[SOLVED]Undefined symbols for architecture x86_64 occurred when I customized the CCDirector.h

$
0
0

@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?
disappointed_relieved

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 17103

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>