是否可以在 Ubuntu 下的 32 位系统上编译 64 位可执行文件? [英] Is it possible to compile a 64 bit executable on a 32 bit system under Ubuntu?
问题描述
而且,如果可能的话,能否请您给我举个例子?谢谢!
And, if it is possible, can you please point me to an example of this? Thanks!
推荐答案
您正在寻找的是交叉编译.http://en.wikipedia.org/wiki/Cross_compiler#GCC_and_cross_compilation
What you are looking for is cross compilation. http://en.wikipedia.org/wiki/Cross_compiler#GCC_and_cross_compilation
正如 Tomas 所说,您需要安装目标机器的库,并且假设您正在使用 gcc,您将需要使用-b 机器"选项,可能还有其他一些选项(man gcc,并花费很多时间阅读!).
As Tomas said, you need the libs of the target machine installed and assuming you are using gcc you will need to use the "-b machine" option, and probably a few other options also (man gcc, and spend a lot of time reading!).
这真的很痛苦,所以我会问是否真的有必要?
This can be a real pain to get right, so i would ask whether it is really necessary?
这篇关于是否可以在 Ubuntu 下的 32 位系统上编译 64 位可执行文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!