AppController.h is object-c header file. And my source is cpp. Only .mm file could include object-c header file. — so don’t use cpp to include .mm head file
=
cocos2d-x-3.0alpha0-pre + iOS7 SDK + xcode Version 5.0 (5A1413)
.cpp
include follow #if (CC_TARGET_PLATFORM CC_PLATFORM_IOS) #include “AppController.h” #endif
build error, because iOS ‘Point’ type is the same as cocos2d-x 3.0 alpha ‘Point’
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/MacTypes.h:534:9: Reference to ‘Point’ is ambiguous
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:377:43: Unknown type name ‘NSString’
i know to add cocos2d::Point to .cpp, but iPhoneOS7.0.sdk/usr/include/MacTypes.h is iOS system SDK, so don’t change system SDK.
Maybe cocos2d-x use Point type is not good?
@James Chen
i know to add cocos2d::Point to .cpp, but iPhoneOS7.0.sdk/usr/include/MacTypes.h is iOS system SDK, so don’t change system SDK.
Maybe cocos2d-x use Point type is not good?
@James Chen
you can try this, it will tips iOS7 SDK MacTypes.h Reference to ‘Point’ is ambiguous
.cpp
1. include follow
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
#include "AppController.h"
#endif
2. build error, because iOS 'Point' type is the same as cocos2d-x 3.0 alpha 'Point'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/usr/include/MacTypes.h:534:9: Reference to 'Point' is ambiguous
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:377:43: Unknown type name 'NSString'
@james chen
AppController.h is object-c header file. And your source is cpp. right? Only .mm file could include object-c header file.
i fix it:
AppController.h is object-c header file. And my source is cpp. Only .mm file could include object-c header file. — so don’t use cpp to include .mm head file
I had the same problem.
It turned out “MacTypes.h” was referenced in one file in my project, probably because of a little to much “help” from my ide. Anyway, removed that, and I was up and running again…
-Christian
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/usr/include/MacTypes.h:533:16: Reference to ‘Point’ is ambiguous
I’m having the same issue. My project uses RakNet which includes MacTypes.h on anything Apple.
>
I have no problem adding cocos2d::, but the problem is other files I include like Sprite.h, etc, all get the ambiguous issues as well.