我越来越对MacTypes.h两行的typedef重新定义错误,在下面的代码块:
#if __LP64__
typedef unsigned int UInt32;
typedef signed int SInt32;
#else
typedef unsigned long UInt32; // error here
typedef signed long SInt32; // error here
#endif
铛错误点以下之前的定义,在CFBase.h(在CoreFoundation.framework):
#if !defined(__MACTYPES__)
#if !defined(_OS_OSTYPES_H)
typedef unsigned char Boolean;
typedef unsigned char UInt8;
typedef signed char SInt8;
typedef unsigned short UInt16;
typedef signed short SInt16;
typedef unsigned int UInt32; // previous definition is here
typedef signed int SInt32; // previous definition is here
typedef uint64_t UInt64;
typedef int64_t SInt64;
typedef SInt32 OSStatus;
#endif
...
这是很奇怪的,因为__LP64__
显然是总是正确的在Mac平台上,所以这是为什么即使typedef的被评估? 为什么会出现汇编,其中两个OS提供的定义是相互矛盾的路径?
编辑:这是在Xcode中错误的屏幕截图。
我削除,包括文件的路径<Carbon/Carbon.h>
因为它包含了我的客户端的名称(该文件是为这两个错误是相同的)。 下面是完整的路径名如下(包含的所有Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks):
- Carbon.framework /头/ Carbon.h:20
- CoreServices.framework /头/ CoreServices.h:18
- CoreServices.framework /框架/ AE.framework /头/ AE.h:20
- CoreServices.framework /框架/ CarbonCore.framework /头/ CarbonCore.h:27
- CoreServices.framework /框架/ CarbonCore.framework /头/ MacTypes.h:27
更新:
在我自己的代码,只是之前#include <Carbon/Carbon.h>
我已经添加了以下内容:
#if __LP64__
#error Has LP64
#else
#error Doesn't have LP64
#endif
......而我得到了“没有LP64”的错误,因此这似乎是问题的根源。 然而,当我编译崇高文字2(与SublimeClang)以下...
int main()
{
#if __LP64__
#error Has LP64
#else
#error Doesn't have LP64
#endif
return 0;
}
......我得到“有LP64”。 做一个项目的文本搜索#define __LP64__
我无法找到我的项目什么,以供搜索时__LP64__
它只是想出了一个负载#if
S和#ifdef
秒。 有谁知道这个错误可能来自哪里?