App Code Bug in combination with Cocos2d-x - Help Upvote

Thank you, I’ve tried this and it seems to work so far.

I even commented the TargetConditionals.h back in as I was a bit worried this might break something.

But it still seems to work.

Does it also work for you this way?

// Apple: Mac and iOS
#if defined(__APPLE__) && !defined(ANDROID) // exclude android for binding generator.
#include <TargetConditionals.h>
//#if TARGET_OS_IPHONE // TARGET_OS_IPHONE includes TARGET_OS_IOS TARGET_OS_TV and TARGET_OS_WATCH. see TargetConditionals.h
//#undef  CC_TARGET_PLATFORM
//#define CC_TARGET_PLATFORM         CC_PLATFORM_IOS
//#elif TARGET_OS_MAC
//#undef  CC_TARGET_PLATFORM
//        #define CC_TARGET_PLATFORM         CC_PLATFORM_MAC
//#endif

#undef  CC_TARGET_PLATFORM
#define CC_TARGET_PLATFORM         CC_PLATFORM_IOS
#endif

More or less. I’m still getting some parse errors now I’ve got a bit more code into the project :weary:

Your solution seems to work partially, the problem is that I need to build for Mac and for iOS.

I’ve just tried all sorts of trickery to define for IOS and MAC correctly, but nothing worked out.

As soon as I use TARGET_OS_IPHONE to determine it’s iOS, the issue appears.

Do you have an idea how I could overcome this?

Nope. Tried the same myself. AppCode is just a bit broken :confused:

Actually it looks like the problem is that the Base SDK for the libcocos2d tvOS project is set to “appletvos9.1” and shows as “not found” even though I have tvOS SDK 9.1 installed (or at least I think I do).

Changing it to “Latest tvOS (…)” allows AppCode to parse the project correctly.

The suggestion came from JetBrains.

2 Likes

Seems like we did it. I just hope we can use App Code now finally and there’s not any more other parsing errors anywhere.

Thanks for your investigations again @nivrig