Symbol(s) not found for architecture i386

Hi everyone,

I am using Xcode 7.0 and target building is iOS 9.0, I have this problem :frowning: I think it is setting issue and I google it but seem to no answers.

"GameScene::onContactBegin(cocos2d::PhysicsContact&)", referenced from:
  GameScene::init() in GameScene.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Here is my source

bool onContactBegin(cocos2d::PhysicsContact& contact );

auto contactListener = EventListenerPhysicsContact::create( );
contactListener -> onContactBegin = CC_CALLBACK_1( GameScene::onContactBegin, this );
Director::getInstance( )->getEventDispatcher( )->addEventListenerWithSceneGraphPriority( contactListener, this );

Full code at here

Thanks.

This issue typically occurs when:

  1. You did not add the .cpp file into the target.
  2. You declare the function, but do not implement the function.

For ( 1 ), it is just a matter of adding the file back to the build target. For ( 2 ), just implement an empty function will do, even if you are not doing anything with it at the moment.

1 Like