I have moved my project from version 2.5 to 3.2. As soon as I add an .m or .mm file which I need for InAppPurchase and GameCenter, I can’t compile the project anymore. It looks like the #import <Cocoa/Cocoa.h> statement in the Prefix.h gets compiled and that causes errors.
‘Size’ is ambigous for example.
It worked perfectly with 2.5. Is there anything I need to do differently when trying to add native code to a 3.2 project?
A lot of class got renamed between V2 and V3 (for example CCSize became Size), which may cause problems if you have other classes with the same name (happened to me, I just had to specify the namespaces).
I read somewhere that ‘using namespace cocos2d’ could cause problems in header files.
So I removed them all, adding coco2d:: to every occurence. Took a while but voila, I can successfully build and run my project again.
Believe it or not, this project got created with version cocos2d-x 1.0 and I migrated it 4 times now