Lion 上 Xcode 4.1 出现奇怪的编译错误

发布于 2024-11-27 18:35:37 字数 589 浏览 6 评论 0原文

我刚刚将我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

从此见与不见 2024-12-04 18:35:37

我遇到了同样的问题,并且能够通过将其更改

#import "/usr/include/objc/runtime.h"

#import <objc/runtime.h>

包含此文件的位置来解决它。此更改似乎也向后兼容在 Snow Leopard 下运行的 4.0.2。

I had the same issue, and was able to resolve it by changing this

#import "/usr/include/objc/runtime.h"

to this

#import <objc/runtime.h>

where ever I included this file. This change appears backward compatible with 4.0.2 running under Snow Leopard as well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文