Linker error in XCode 8.3.3 with cocos2d-x 3.15.1

Hello everyone,

I’ve been getting ready to release a new version of my app, and after the mandatory update from XCode to the latest version so I could test the app on my iPad running iOS 10.3, I decided to update to the latest version of cocos2d-x, from v3.8 to v3.15.1.

After updating and adding all my files back into the project, I’m getting the following linker error:

Undefined symbols for architecture arm64:
  "AppDelegate::AppDelegate()", referenced from:
      ___cxx_global_var_init.2 in AppController.o
  "AppDelegate::~AppDelegate()", referenced from:
  ___cxx_global_var_init.2 in AppController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have no idea what is causing this error. For reference, I have the following valid architectures set: arm64, armv7, and armv7s. I also have “build active architecture only” set to “yest” on Debug and “no” on Release. This error did not occur when building with the previous version of cocos2d-x. Any ideas why this is happening?

Cheers!

Update: I tried using a blank project to test if the problem would go away. If I use a blank project (created by using “cocos new”), then everything compiles fine. The issue is when I go and add my files back in to the new project. Just for reference, I have my files organized into 2 sub-folders within the Classes directory. The layout looks as follows:

Classes
|
|- include (all .h files)
|- source (all .cpp files)

This layout works in Windows and worked with the previous version of cocos. It is only with the update that the build broke. I do make a minor change on the project settings where I add “$(SRCROOT)/…/Classes” as a search directory so it can find the header files.

Did you find solution for this?