MinGW and Cygwin – An Introduction and Differences

If you are using Linux and your are a big fan of shell and its other utilities like grep, ls, make and its compilers gcc and g++, and if you want these utils on Windows platform, then this articles is for you. Even if you are not a developer, but still want to explore some Linux based utilities on your Windows Machine, this articles is for you too. Or if you have just heard these names and and you have wondered what these are, then this article is for you also.

So what is all this fuss about MinGW and Cygwin? What it is? And most importantly why do I need it? So lets first take MinGW. MinGW stands for Minimalist GNU for Windows. This is a project for providing native GCC compiler for Windows platform. According to MinGW website:

MinGW provides a complete Open Source programming tool set which is suitable for the development of native MS-Windows applications, and which do not depend on any 3rd-party C-Runtime DLLs. (It does depend on a number of DLLs provided by Microsoft themselves, as components of the operating system; most notable among these is MSVCRT.DLL, the Microsoft C runtime library. Additionally, threaded applications must ship with a freely distributable thread support DLL, provided as part of MinGW itself).

It provides GCC, make, debugger etc which is necessary for developing on Windows platform. Along with it provides MSYS, which stands for “Minimal System”. It is a Bourne Shell command line interpreter which can be used as an alternative to cmd.exe present in MS Windows systems. It provides a selection of Unix tools like grep, ls, ps, whoami, pwd etc which facilitates your work as a developer.

Ok, that was MinGW. So what is Cygwin? It is a toolset, which can make you feel like if you are working on Linux platform. Let see what Cygwin website says about it:

Cygwin is:

  • a collection of tools which provide a Linux look and feel environment for Windows.
  • a DLL (cygwin1.dll) which acts as a Linux API layer providing substantial Linux API functionality.

So is it not a development environment? Certainly it is. If also has GCC tool-chain for compilation,debugging and make. It has more complete set of utilities which are present in Linux. So what is difference in these two?

Cygwin adds a Linux API layer to emulate Linux functionality. This also includes POSIX standards. But MinGW aims at providing a native GCC compiler for Windows platform. In case of utilities Cygwin tries to provide you a most complete set of Linux Functionality, while MinGW aims at providing minimalist Linux feel. Here comes one liner citing the difference:

Cygwin = Lets put unix on windows, use as much native unix stuff as possible
MingW = Lets keep unix out of windows as much as possible, us as much native windows stuff as possible.

If you are compiling your program with MinGW, then the generated binaries can be distributed without any dependencies on external DLL. While programs compiled with Cygwin need cygwin1.dll for running the program. However POSIX is supported in Cygwin but not is the same case with MinGW.

That’s all I have as of now on Cygwin and MinGw. If you want to download one or both of them, here is the place:

If you have used them, please share you experience with other users in comments below.

  • Binh Thanh Nguyen

    Thanks, nice explanation

  • Dipen

    Very well simplified. Thank you.