如何使用 LLVM GCC 在设备上编译 iPad 应用程序?

发布于 2024-10-28 07:39:59 字数 367 浏览 3 评论 0原文

我将我的应用程序设置为在“编译器版本”下的“目标”>“构建设置”中使用 LLVM GCC 4.2,并且它适用于模拟器。

当我将我的“方案”切换到 iPad 时,它抛出了与我使用 GCC 时收到的相同的警告,所以我假设它现在正在 GCC 下编译。但“C/C++ 编译器版本”目标仍然设置为 LLVM GCC 4.2(除了在 iOS 默认情况下,它是 GCC 4.2 并且我无法更改)。

为什么它不再使用 LLVM GCC 进行编译?我该如何更改它以便在 iPad 下也能进行编译?

编辑:我遇到的错误与访问超类的实例变量有关。如果您没有将其写为 [self iVarName],GCC 会给出错误,而如果您只使用 iVarName,则 LLVM GCC 可以正常编译。

I have my application set up to use the LLVM GCC 4.2 in Target>Build Settings under Compiler Version and it worked for the simulator.

When I switched my "Scheme" to target an iPad, it threw the same warnings as I was getting when using GCC, so I'm assuming it is compiling under GCC now. But the "C/C++ Compiler Version" target is still set to LLVM GCC 4.2 (except under iOS Default, where it is GCC 4.2 and I cannot change).

Why is it not compiling with LLVM GCC anymore and how can I change it so it does under the iPad?

Edit: The error I was getting has to do with accessing a superclass's instance variable. GCC gives an error if you did not write it as [self iVarName] while LLVM GCC compiles fine if you just use iVarName.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

疏忽 2024-11-04 07:39:59

LLVM GCC 是带有 GCC 编译器的 LLVM 预处理器,因此您应该看到相同的错误消息(由于 LLVM,在 IDE 中还会看到更多错误消息)。您可以尝试 LLVM 编译器 2.0,但目前它有一些错误。要设置编译器,请选择左上角的项目,点击“构建设置”选项卡并更改编译器。

LLVM GCC is te LLVM preprocessor with the GCC compiler, so you should see the same error messages (and a few more in the IDE thanks to LLVM). You could try the LLVM Compiler 2.0, but it has a few bugs at the moment. To set the compiler, choose the project at the top left, tap the Build Settings tab and change the compiler.

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