如何在 Mac 上编译 GCC,以便编译后的可执行文件可以在早期版本的 OS X 上运行?

发布于 2024-09-24 19:29:51 字数 253 浏览 1 评论 0原文

我正在尝试构建一个程序(Dwarf Fortress),该程序使用 C++0x 功能,而最新的 Leopard 版本的 XCode 并未很好地支持这些功能。由于使用 GCC 4.5 也显着提高了速度,因此我们决定构建自己的 GCC 4.5。

然而,这会导致生成的可执行文件无法在 Tiger 上运行,因为 libc 中缺少符号。据推测,GCC 是针对 Leopard SDK 构建的,而不是针对已安装的 Tiger SDK,这是合理但令人讨厌的。我怎样才能让它与老虎的对抗呢?

I'm attempting to build a program (Dwarf Fortress) that uses C++0x features that aren't well supported in the latest Leopard version of XCode. As there is also a significant speed boost from using GCC 4.5, we've decided to build our own.

However, this causes the resulting executables to not work on Tiger, citing missing symbols in libc. Presumably, GCC is being built against the Leopard SDK, not the installed Tiger SDK, which is reasonable but annoying. How would I make it build against Tiger's?

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

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

发布评论

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

评论(1

十六岁半 2024-10-01 19:29:51

您需要将 -mmacosx-version-min=10.5 传递给 ld,这将告诉它链接到 libc 中的适当符号。

You need to pass -mmacosx-version-min=10.5 to ld, which will tell it to link against the appropriate symbols in libc.

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