适用于iOS模拟器的Cocos2d-x构建



我在玩cocos2d-x,试图构建示例,但我一直收到一个错误"Cannot recognize the target platform; are you targeting an unsupported platform?",下面是iPhone目标的ifdef语句。但它似乎并没有拿起iOS模拟器。

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

我需要改变什么才能在iOS模拟器上工作吗?

转到cocos2dx/platform文件夹中的文件CCPlatformConfig.h。更改线路,

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

到目标平台。在您的情况下,它是iOS。

#define CC_TARGET_PLATFORM             CC_PLATFORM_IOS

在项目C++设置中,您应该添加define CC_TARGET_OS_IPHONE

最新更新