可32位和64位code混合? [英] Can 32-bit and 64-bit code be mixed?

查看:320
本文介绍了可32位和64位code混合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
  链接32位库64位程序

一个程序使用的库,这需要静态链接的,是一个32位之一。如果使用64位编译器编译,它打破了,主要是因为变量类型具有不同的长度(长是长了一倍,主要是)。提供的库源$ C ​​$ C。
程序本身工​​作在32位和64位。
是否有可能编译库为32位和静态链接到64位应用程序?

One of the libraries a program uses, which needs to be statically linked, is a 32-bit one. If compiled with a 64-bit compiler, it breaks, mostly because the variable types are of different length (long being twice as long, mostly). Source code of the library is provided. The program itself works at 32 and 64 bit. Is it possible to compile the library as 32-bit and statically link it to a 64-bit application?

推荐答案

基本上,不,你不能链接,静态或动态,32bit和64bit code,不能在x86反正。

Basically, no, you can't link, statically or dynamically, 32bit and 64bit code, not on x86 anyway.

您的能有什么的做的是写在一个单独的进程中运行,并使用RPC连接图书馆的code的包装。 nspluginwrapper 在Linux上做类似的东西为Flash。

What you can do is write a wrapper that runs in a separate process and uses RPC to "link" the library to your code. nspluginwrapper on Linux does something like that for Flash.

这篇关于可32位和64位code混合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆