Is it possible to compile Windows binaries on a Linux machine?

In my work, all the project data is in NFS, accessible both from Linux and from Windows computers (using Samba). All the work is done on Linux, but I want to compile some tools for Windows so that I can debug work with Visual Studio.

I already have a good make file that can create code for 32-bit or 64-bit Linux using different purposes. Assuming I have the Windows version of all external libraries somewhere in NFS, and if the code is clean enough to compile under Windows, is it possible to compile and link my Windows program using an existing makefile on Linux? Ideally, I would like to call makefile once and build all three 32-bit Linux, 64-bit Linux, and Windows.

An added plus would be the ability to compile it with any Visual Studio metadata to facilitate debugging.

+5
linux windows cross-platform compilation
Oct 04 '09 at 15:40
source share
4 answers

Yes, you can achieve this with MinGW , for example.

However, you may have to adapt one or two parameters in your file.

+4
04 Oct '09 at 15:53
source share

You are requesting a " cross-compiler ".

+2
Oct 04 '09 at 15:45
source share

There are several possibilities that I can think of:

  • You can try running Visual Studio under Wine. If Visual Studio does not start, you can still run command line tools.

  • Run a full installation of Windows in a virtual machine. I did it from Linux to Windows, but not vice versa, but I'm sure it is possible.

  • Use VNC to access a standalone PC from a PC with a Linux PC

  • Use GCC Cross Build instead of Visual Studio

+1
Oct 04 '09 at 15:56
source share

You need a cross compilation package. You can also use Wine lib.

+1
Oct 04 '09 at 15:58
source share



All Articles