在Linux中编译Windows C控制台应用程序

Joh*_* F. 2 c windows ubuntu

我可以在Linux中编译Windows C控制台应用程序(.exe)吗?(更具体地说,Ubuntu)

我很久以前就听过交叉编译器,但当时我对它们并不感兴趣.

最好的祝福

Yac*_*oby 14

这个帖子这给一些信息,以及这个重复的问题

当你使用Ubuntu时,你需要的软件包(我认为) mingw32

apt-get install mingw32
Run Code Online (Sandbox Code Playgroud)

然后用i586-mingw32msvc-gcc编译,例如

i586-mingw32msvc-gcc helloworld.c -o helloworld.exe
Run Code Online (Sandbox Code Playgroud)