Xcode 4:“error:unknown type name'BOOL';你的意思是“BOOL”吗? [英] Xcode 4: "error: unknown type name 'BOOL'; did you mean 'BOOL'?"

查看:3354
本文介绍了Xcode 4:“error:unknown type name'BOOL';你的意思是“BOOL”吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,在Xcode 3.2.x下工作得很好。在Xcode 4.2下,我在编译时收到以下错误:

I have a project which worked great under Xcode 3.2.x. Under Xcode 4.2, I'm getting the following error when compiling:

"error: unknown type name 'BOOL'; did you mean 'BOOL'?"



我可以右键点击有问题的 BOOL 而Xcode会跳到苹果的定义。 BOOL 定义在< objc / objc.h> ,所以我将它包含在我的源文件事实,我使用预编译头与UIKit.h和Foundation.h)。仍然没有喜悦 - 编译错误仍然存​​在。

I can right click on the offending BOOL and Xcode will jump to Apple's definition. BOOL is defined in <objc/objc.h>, so I included it in my source file (despite the fact that I'm using precompiled headers with UIKit.h and Foundation.h). Still no joy - the compile error persists.

对于Xcode 4工作周围的任何想法将不胜感激。 Google提供了0个匹配。

Any ideas for Xcode 4 work arounds would be appreciated. Google is offering 0 hits.

编辑:添加了违规代码以消除任何歧义。

added the offending code to remove any ambiguity.

// AppConstants.h
typedef enum { ThreadPriorityLow = NSOperationQueuePriorityLow, ThreadPriorityNormal = NSOperationQueuePriorityNormal,
    ThreadPriorityHigh = NSOperationQueuePriorityHigh, ThreadPriorityDefault = ThreadPriorityNormal } ThreadPriority;

static inline BOOL IsValidThreadPriority(ThreadPriority priority)
{
    return priority == ThreadPriorityLow || priority == ThreadPriorityNormal || priority == ThreadPriorityHigh;
}

编辑:查看Emacs和HexFiend之后的源代码以查找非法字符没有(源是8位干净的),我倾向于认为这是由于苹果的一部分bug。

after looking at the source under Emacs and HexFiend for illegal characters and finding none (source is 8-bit clean), I'm inclined to believe this is due to some kind of bug on Apple's part.

推荐答案

这是苹果软件。

苹果忽视了我的3.2.6项目设置,并决定使用LLVM 3.0套件,而不是GCC 4.2。以前(在Xcode 3.2.6下),由于我广泛使用GCC警告和标志,我特别设置了使用GCC的项目。

Apple disregarded my 3.2.6 projects settings and decided to use the LLVM 3.0 suite rather than GCC 4.2. Previously (under Xcode 3.2.6), I had specifically set the project to use GCC due to my extensive use of GCC warnings and flags.

' - >'编译C / C ++ / Objective'回到GCC 4.2,它工作。

After I changed 'Build Settings' -> 'Compile for C/C++/Objective' back to GCC 4.2, it worked.

Apple Radar 10278815报告, LLVM错误11126 报告。希望苹果会在Xcode 5之前修复它。

Apple Radar 10278815 reported, and LLVM Bug 11126 reported. Hopefully Apple will fix it before Xcode 5.

这篇关于Xcode 4:“error:unknown type name'BOOL';你的意思是“BOOL”吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆