Box2D xcode 项目编译器错误“Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 失败,退出代码 1”

发布于 2024-11-19 08:23:09 字数 572 浏览 1 评论 0原文

我正在尝试从 box2d svn 存储库编译 Box2D.xcodeproj 。当我加载该项目时,我收到一条警告:

目标 Box2D 中缺少 SDK: iphoneos2.2

当我尝试编译时出现两个错误:

命令 /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 失败,退出代码为 1

命令 /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 失败,退出代码为 1

编辑:我又研究了一下并将目标 sdk 设置为 iphoneos4.3(最新),现在我只收到一个错误:

[BEROR]没有可编译的架构 (ONLY_ACTIVE_ARCH=YES,活动 arch=i386、VALID_ARCHS=armv7)。

有什么想法吗?

I'm trying to compile the Box2D.xcodeproj from the box2d svn repo. When I loaded up the project I had a warning saying that:

Missing SDK in target Box2D:
iphoneos2.2

And when I tried compiling I got two errors:

Command
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2
failed with exit code 1

Command
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2
failed with exit code 1

edit: I poked around a bit more and set the target sdk to be iphoneos4.3 (latest) and now I'm getting just one error:

[BEROR]No architectures to compile for
(ONLY_ACTIVE_ARCH=YES, active
arch=i386, VALID_ARCHS=armv7).

Any ideas why?

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

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

发布评论

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

评论(2

有木有妳兜一样 2024-11-26 08:23:09

您是否尝试过进入 Box2D 项目设置,并将选定的 SDK 从“iphoneos2.2”更改为“最新 iOS”(或您在其他成功构建的项目中碰巧使用的任何内容)?

编辑

更新后,Box2D 似乎被配置为为设备构建,而您正在尝试为 iPhone 模拟器构建它。您可以通过尝试在设备(特别是 iPhone 3GS 或更高版本)上构建和运行来测试这一点。为了更好地修复,请进一步编辑您的 Box2D 项目,并禁用“仅构建活动架构”选项,并将 i386 和 armv6 添加到有效目标架构列表中。从理论上讲,这应该可以解决剩下的问题。

Have you tried going to the Box2D project settings, and changing the selected SDK from "iphoneos2.2" to "Latest iOS" (or whatever you happen to be using in your other projects that build successfully)?

Edit

After your update, it appears that Box2D is configured to build only for the device, and you are attempting to build it for the iPhone simulator. You can test this by trying to build and run on a device (specifically, an iPhone 3GS or above). For a better fix, edit your Box2D project some more, and disable the "Build active architecture only" option, and add i386 and armv6 to your list of valid target architectures. In theory that should clear up the remaining issue.

塔塔猫 2024-11-26 08:23:09

我怀疑 Box2D 项目相当旧(由于引用了 iphoneos2.2),并且使用最新版本的 Xcode 打开它并没有很好地转换所有选项(我这样说是因为它对于我在旧项目中经历过此类问题)。

对于您的情况,我建议尝试禁用“仅构建活动架构”标志,您可以在项目的构建设置中找到该标志,然后看看会发生什么。您可能还会考虑将与架构相关的所有设置重置为其默认值。

另外,尝试为设备进行编译,只是为了检查这是否有效。

如果我的建议没有帮助,我知道解决此类问题的唯一方法是检查 Xcode 项目包中找到的 project.pbxproj 并消除错误(通常,有是一些重复的配置或过时的信息)。

PS:您的设置问题可能出现在项目级别或目标级别,因此请检查两者。

I suspect that the Box2D project is pretty old (due to the reference to iphoneos2.2) and that opening it with a late version of Xcode did not do a good job at converting all the options (I say this because it is pretty common for me to experience this kind of problems with older projects).

In your case I would suggest to try and disable the "Build active architecture only" flag that you can find in the build settings for your project and see what happens. You might also think of resetting all the settings related to the architecture to their default values.

Also, try to compile for the device, just to check if this works.

If my suggestion does not help, the only way I know of troubleshooting this kind of problems is inspecting the project.pbxproj that is found in your Xcode project bundle and get rid of what is wrong (usually, there is some duplication of configuration, or stale information).

PS: the problem with your settings could either be at the project level or at the target level, so inspect both.

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