2013-07-29 86 views
0

我在玩Cocos2d-x试图获得构建的例子,但我一直得到一个错误"Cannot recognize the target platform; are you targeting an unsupported platform?"是iPhone目标的ifdef语句。但它似乎没有拿起iOS模拟器。Cocos2d-x为iOS模拟器生成?

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

有什么我需要改变,让它在iOS模拟器上工作?

回答

1

在项目C++设置,您应该添加定义CC_TARGET_OS_IPHONE

0

转到文件CCPlatformConfig.hcocos2dx/platform文件夹中。更改行,

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

到目标平台。你的情况是iOS。

#define CC_TARGET_PLATFORM    CC_PLATFORM_IOS