Steven
Steven

Reputation: 13995

Cocos2d-x Build for iOS Simulator?

I am playing around with cocos2d-x trying to get the example to build but I keep getting an error "Cannot recognize the target platform; are you targeting an unsupported platform?" below is the ifdef statement for the iPhone target. But it doesn't seem to be picking up the iOS Simulator.

#if defined(CC_TARGET_OS_IPHONE)
    #undef  CC_TARGET_PLATFORM
    #define CC_TARGET_PLATFORM         CC_PLATFORM_IOS
#endif

Is there something I need to change to get it to work on iOS Simulator?

Upvotes: 0

Views: 2586

Answers (2)

NightFury
NightFury

Reputation: 13546

Go to file CCPlatformConfig.h in cocos2dx/platform folder. Change the line,

// Determine target platform by compile environment macro.
#define CC_TARGET_PLATFORM             CC_PLATFORM_UNKNOWN

to the targeted platform. In your case it is iOS.

#define CC_TARGET_PLATFORM             CC_PLATFORM_IOS

Upvotes: 2

Seagull
Seagull

Reputation: 3610

In the project C++ settings you should add define CC_TARGET_OS_IPHONE

Upvotes: 1

Related Questions