OSX 链接非通用 (i386) 和通用 .dylib
这合法吗?我收到错误“找不到
我认为一切都必须通用或不通用......
Is this legal? I'm getting an error "Can't find <lib>.framework/Versions/4/<lib>" from the linker. In this case, <lib> is 'QtGui' that has been built as an i386 framework (not universal), but another (third party) lib I'm linking to (that uses QtGui) is universal.
I'm thinking everything has to be built universal or not...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将非通用框架(例如仅 i386)与通用框架(例如 i386 和 x86_64)链接起来以生成 i386 二进制文件。
当然,在这种情况下您无法制作 x86_64 二进制文件。
请注意,如果您的 Mac 具有 64 位 CPU,则链接器默认为 x86_64 二进制文件。因此,如果您的任何库没有 x86_64 部分,链接器将会抱怨。如果要创建 i386 二进制文件,则需要在命令行上明确指定。
You can link a non-universal framework (say i386 only) with a universal framework (say with i386 and x86_64) to make an i386 binary.
Of course you can't make an x86_64 binary in this case.
Note that if your Mac has a 64 bit CPU, the linker defaults to mae an x86_64 binary. So the linker will complain if any of your library does not have the x86_64 part. If you want to create an i386 binary, you need to specify that explicitly on the command line.
罗杰.
事实证明,我的问题实际上源于必须重置的外部库中的错误嵌入路径(我认为这不会影响链接,但确实如此)。
通用构建问题被怀疑是罪魁祸首,但事实并非如此。
谢谢,
里克布
Roger.
Turns out my issue actually stems from bad embedded paths in the external libraries that have to be reset (which I didn't think would affect links, but it does).
The universal build issue was a suspected culprit, but no.
Thanks,
rickb