在MacOSX上将32位共享库与Intel 64位架构(x86_64)相链接

时间:2022-09-18 14:18:58

I have a 32-bit shared library that I need to link with my application (a 64-bit version is apparently not available, and I do not have the source code to rebuild it). However, I must build my application using 64-bit architecture due to a bug I've encountered with the Silverlight plugin when building for 32-bit architecture. The details of this bug can be found here

我有一个32位共享库,我需要与我的应用程序链接(64位版本显然不可用,我没有重建它的源代码)。但是,我必须使用64位体系结构构建我的应用程序,因为我在构建32位体系结构时遇到了Silverlight插件遇到的错误。可以在此处找到此错误的详细信息

Needless to say, I get the following linker warning

不用说,我得到以下链接器警告

ld: warning: ignoring file xxx.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64)

So is there any way to link a 32-bit shared library when building for the 64-bit architecture?

那么在为64位架构构建时,有没有办法链接32位共享库?

1 个解决方案

#1


2  

No, there is not. 32-bit code and 64-bit code are fundamentally incompatible with one another; there is no way to link a 64-bit binary to a 32-bit library or vice versa.

不,那里没有。 32位代码和64位代码从根本上是不兼容的;没有办法将64位二进制文​​件链接到32位库,反之亦然。

#1


2  

No, there is not. 32-bit code and 64-bit code are fundamentally incompatible with one another; there is no way to link a 64-bit binary to a 32-bit library or vice versa.

不,那里没有。 32位代码和64位代码从根本上是不兼容的;没有办法将64位二进制文​​件链接到32位库,反之亦然。