编译在Linux下Windows的C控制台应用程序 [英] Compile Windows C console applications in Linux

查看:355
本文介绍了编译在Linux下Windows的C控制台应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以编译Linux的一个Windows的C控制台应用程序文件(.exe)? (更具体的,Ubuntu)

我听说很久以前交叉编译器,但我并没有在那个时候对它们感兴趣。

Can I compile a Windows C console application (.exe) in Linux? (more specific, Ubuntu)
I heard a long time ago of cross-compilers, but I wasn't interested in them at that time.

最好的问候,

约翰·F。

Best regards,
John F.

推荐答案

帖子这给一些信息,以及本重复

There is this post which gives some info, as well as this duplicate question

当你正在使用Ubuntu,你需要的是包(我认为)的mingw32

As you are using Ubuntu, the packages you need is (I think) mingw32

apt-get install mingw32

然后用i586的-mingw32msvc-GCC,例如编译。

Then compile with i586-mingw32msvc-gcc, e.g.

i586-mingw32msvc-gcc helloworld.c -o helloworld.exe

这篇关于编译在Linux下Windows的C控制台应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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