Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to use a Linux Application under Windows. It is my understanding that the application is Linux only and to use it in Windows I have to compile the application from the source using Cygwin or MinGW.

My question is which to use: Cygwin or MinGW?

Should i setup Cygwin or MinGW in Windows and then compile the Linux Application there?

Should i setup Cygwin or MinGW in Linux and then compile the Linux Application there?

Any guide/tutorial?

share|improve this question
What features does the application use (e.g. command line or GUI, does it use unix-y features such as interprocess communication or permissions intensively)? Depending on the answer, this can go from trivial to extremely complicated. – Gilles Apr 20 '11 at 21:02
It is a command-line application. No IPC or Permissions. – MA1 Apr 21 '11 at 7:24

Cygwin aims to maximise POSIX and Linux source compatibility, whereas MinGW provides a GNU toolchain for building native Windows application. Hopefully this means that your Linux application requires no or only minor changes to build on Cygwin, whereas porting code using POSIX/Linux-specific APIs to native Windows can be a major effort. However, if you can make it work with MinGW, that saves you the dependency on the Cygwin DLL.

Building with a cross-compile environment on Linux tends to be faster, but also more difficult, especially with regards to libraries that applications may depend on. And obviously you'll need to test on Windows anyway.

share|improve this answer
Setting up CygWin on Windows... – MA1 Apr 21 '11 at 7:26

Setup your cygwin environment on windows, then compile there.

share|improve this answer
what about setup the environment in Linux, and then compile there? – MA1 Apr 20 '11 at 12:22
@MA1 Cygwin is a system that provides a unix like environment on top of Windows. Cygwin on top of linux would be a meaningless combination! Your application needs to be compiled in and for the environment it will run under, so it needs to be compiled in cygwin on windows since that is what you want to end up with in the end. – Caleb Apr 20 '11 at 13:14
@MA1 Yes, you can cross-compile Windows executables on Linux. There are many tutorials covering this, this one for example: blogcompiler.com/2010/07/11/compile-for-windows-on-linux – Let_Me_Be Apr 20 '11 at 13:20
@Caleb The application definitely doesn't need to be compiled in the environment it is built for. Or do you think that embedded chips actually have to capable of running a compiler? – Let_Me_Be Apr 20 '11 at 13:21
@Caleb; @Let_Me_Be; Great Great Thanks.....Setting up CygWin on Windows... – MA1 Apr 21 '11 at 7:27

Actually, you can work without both.

Windows (from Windows 7) claims to be fully POSIX compliant. Unfortunately as many other important features, this is only available for Enterprise and Ultimate editions.

For earlier versions of Window there are Windows Services for UNIX.

share|improve this answer
Even on Windows 7 Enterprise and Ultimate, the "Subsystem for Unix Applications" (aka Interix) is an optional component. Furthermore, it runs in its own subsystem directly on the NT kernel rather than within the Windows subsystem, so the result of building for Interix isn't a Windows program as such. – ak2 Apr 20 '11 at 14:13
@ak2 Are you sure? What I read is that the SDK and utilities have to be downloaded separately, but you shouldn't need that for running the programs. – Let_Me_Be Apr 20 '11 at 14:42
No, I'm not sure actually. For all I know the core parts of Interix could be installed by default. – ak2 Apr 21 '11 at 5:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.