Undefined symbols for architecture arm64 [SDKBOX and cocos2dx v2.2.6]

447 Views Asked by At

I am updating a very old game using cocos2dx v2.2.6 and SDKBOX 1.0.16 (that came out today). I have followed all the steps but I hit a deadlock when I updated my iOS target.

I get this error:

Undefined symbols for architecture arm64: "sdkbox::PluginChartboost::show(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from: GameLayer::pauseGame(cocos2d::CCObject*) in GameLayerScene.o "sdkbox::PluginAdMob::isAvailable(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from: GameLayer::pauseGame(cocos2d::CCObject*) in GameLayerScene.o "sdkbox::PluginAdMob::show(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from: GameLayer::pauseGame(cocos2d::CCObject*) in GameLayerScene.o "sdkbox::PluginChartboost::isAvailable(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from: GameLayer::pauseGame(cocos2d::CCObject*) in GameLayerScene.o "sdkbox::PluginAdMob::cache(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from: GameLayer::pauseGame(cocos2d::CCObject*) in GameLayerScene.o AppDelegate::applicationDidFinishLaunching() in AppDelegate.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) As you can see, it cannot identify any method related to Ads but the init function for each plugin works fine and doesn't cause any error.

Anyone noticed such an issue or know what can be causing this? I have double checked the frameworks in link binary with framework.

Thank you.

1

There are 1 best solutions below

2
MoDJ On

You need to fix the build target so that it actually links to the C++ library. One thing to check is to make sure that you actually have a .cpp or .mm file in your project, so that Xcode knows to automatically link the C++ runtime (an empty file with the right extension will do it).