从新 mac 机器为旧 mac 创建应用程序?
我正在 MAC OSX 10.6 上编写一个示例应用程序,其 gcc 版本为 4.2。 我正在使用 gcc 版本 4.2 编译应用程序。 它在同一台机器上工作正常,但在 MAC OSX 10.5 (gcc 4.0) 上它不起作用。 我怎样才能在 10.6 上编译它,以便它也能在旧机器上运行?
我收到这些错误
dyld: unknown required load command 0x80000022
Trace/BPT trap
命令,我用来构建的是
gcc -m32 main.cc
I am writing an sample app on MAC OSX 10.6 having gcc version 4.2.
I am compiling app using gcc version 4.2 .
It is working fine on the same machine but on MAC OSX 10.5 (gcc 4.0) it is not working.
how can I compile it on 10.6 so it will also work on old machine ?
I am getting these error
dyld: unknown required load command 0x80000022
Trace/BPT trap
command I used to build is
gcc -m32 main.cc
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该应用程序错误地在 OS X 10.6 计算机上为 10.5 计算机构建。开发人员可以通过考虑三件事来解决此问题:
解决此问题后,可以通过运行“otool”来检查应用程序是否为 OS X 10.5 正确构建:
otool -l 二进制文件
正确的二进制文件不应包含任何“LC_DYLD_INFO_ONLY”加载命令(仅限“LC_DYLD_INFO”命令)。
(另请参阅我的博客文章 http://grauonline.de/wordpress/?p=71 )
The application was incorrectly built on OS X 10.6 machine for a 10.5 machine. The developer can fix this by considering three things:
After this is fixed, one can check if the application was correctly built for OS X 10.5 by running 'otool':
otool -l binary
The correct binary should not contain any 'LC_DYLD_INFO_ONLY' load commands (only 'LC_DYLD_INFO' commands).
(also see my blog article http://grauonline.de/wordpress/?p=71 )
-arch i386 -Wl,-macosx_version_min,10.5
会有帮助;不过,我不确定它们是否足够。-arch i386 -Wl,-macosx_version_min,10.5
will help; I don't know for certain if they'll be sufficient, though.