Lion 上 Xcode 4.1 出现奇怪的编译错误
我刚刚将我的 Mac 升级到 Lion,然后升级到 Xcode 4.1。我的 iPhone 项目与 Xcode 4.0 配合良好,但在 Xcode 4.1 中出现 401 错误。
我用谷歌搜索了解决方案并找到了两种有用的方法。
- 将编译器从 GCC 4.2 更改为 LLVM 2.1。
- 将
#import "/usr/include/sqlite3.h"
更改为#import
现在错误数量减少到 15 个,表示
函数声明符之后的预期函数体
Runtime.h 文件(内置源文件)中的 OBJC_ARC_UNAVAILABLE 的
。我尝试将 iOS 部署目标从 iOS 3.0 更改为 iOS 4.1 并将其他 C 标志设置为
-D__IPHONE_OS_VERSION_MIN_REQUIRED=040100
但它们都不起作用。
任何帮助将不胜感激。谢谢。
I just upgraded my Mac to Lion and then Xcode 4.1. My iPhone project which worked well with Xcode 4.0 had 401 errors in Xcode 4.1.
I googled the solution and got two useful ways.
- changed the complier from GCC 4.2 to LLVM 2.1.
- changed
#import "/usr/include/sqlite3.h"
to#import <sqlite3.h>
Now the number of errors reduced to 15, saying
Expected function body after function declarator
on OBJC_ARC_UNAVAILABLE
in file Runtime.h, which is a built-in source file.
I tried to change iOS Deployment Target from iOS 3.0 to iOS 4.1 and set Other C Flags as
-D__IPHONE_OS_VERSION_MIN_REQUIRED=040100
But neither of them worked.
Any help will be appreciated. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了同样的问题,并且能够通过将其更改
为
包含此文件的位置来解决它。此更改似乎也向后兼容在 Snow Leopard 下运行的 4.0.2。
I had the same issue, and was able to resolve it by changing this
to this
where ever I included this file. This change appears backward compatible with 4.0.2 running under Snow Leopard as well.