How to compile with Xcode 7

If anyone has issues compiling Cocos2d-x with Xcode 7, then the solution seems to be to correct the libraries that libcocos2d “links” with:

You need to remove all references to .framework and .dylib files as this is now fatal under Xcode 7. It’s never been right anyway as libcocos2d is a static library and therefore there is no link phase. You can only link in .framework and .dylib files in your game’s project file, and that didn’t need updating in my project. What this section does in Xcode is invoke libtool to combine all those libraries into the libcocos2d.a file to save having to specify them individually when linking against Cocos2d-x.

I hope that helps someone.

4 Likes

Also note you can remove the libc++.dylib from the Link Binary With Libraries section of the game project Build Phases as it’s not required; that is covered by the C++ settings in Build Settings.

2 Likes

Also worth mentioning: change Enable Bitcode build setting to No in iOS targets to avoid linker errors (the “was built with bitcode but” kind of error).