是否可以在Linux机器上编译Windows二进制文件? [英] Is it possible to compile Windows binaries on a linux machine?

查看:314
本文介绍了是否可以在Linux机器上编译Windows二进制文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的工作中,所有项目数据驻留在可从Linux和Windows计算机(使用Samba)访问的NFS上。所有的工作都是在Linux上完成的,但我想要编译一些Windows的工具,以便我可以用Visual Studio调试。

At my work all of the project data resides on an NFS that is accessible from both Linux and Windows machines (using Samba). All of the work is done on Linux, but I'm toying with the idea of compiling some of tools for Windows so that I can debug with Visual Studio.

有一个很好的makefile,可以为使用不同目标的32位或64位Linux构建代码。假设我有NFS的所有外部库的Windows版本,并假设代码是足够干净,以便在Windows下编译,是否可以使用现有的makefile,在Linux上编译和链接我的程序为Windows?理想情况下,我想调用makefile一次,并让它构建32位Linux,64位Linux和Windows的所有三个。

I already have a nice makefile that can build the code for both 32-bit or 64-bit Linux using different targets. Assuming I have windows versions of all the external libraries somewhere on the NFS, and assuming the code is clean enough to compile under Windows, is it possible to compile and link my program for Windows using the existing makefile, on Linux? Ideally I'd like to call the makefile once and have it build all three of 32-bit Linux, 64-bit Linux and Windows.

推荐答案

您要求的是称为 交叉编译器

这篇关于是否可以在Linux机器上编译Windows二进制文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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