Click here to Skip to main content
Click here to Skip to main content
Technical Blog

Cygwin vs. MinGW – What to prefer when

, 9 Oct 2012 CPOL
Rate this:
Please Sign up or sign in to vote.
A comparison.

Sometimes we get confused between Cygwin and MinGW when developing open source applications. Of course they are not the same but which one to prefer when is a big challenge.

Differences

MingGW (MSYS) by itself does not contain a compiler or a C library, therefore does not give the ability to magically port UNIX programs over to Windows nor does it provide any UNIX specific functionality like case-sensitive filenames. Users looking for such functionality should look to Cygwin.

Cygwin applications by principle are not considered a “Native Win32 application” because it relies on the Cygwin® POSIX Emulation DLL or cygwin1.dll for Posix functions and does not use win32 functions directly. MinGW on the other hand, provides functions supplied by the Win32 API. While porting applications under MinGW, functions not native to Win32 such as fork(), mmap(), or ioctl() will need to be reimplemented into Win32 equivalents for the application to function properly.

Preference

In MinGW the MSYS is a collection of GNU utilities such as bash, make, gawk and grep to allow building of applications. It is a command prompt where users  run “./configure” then “make” to build programs. The problem is there’s no /usr directory psychically. The root (/) is considered as usr (/usr) path – so you can not create one either. The problem arises while a program depends on third party library – there is no place to put this third party library so that the default search path can find the library file. Usually in linux /usr/local/lib is the default library search path. So the client program can not configure with ”./configure”. You will need special modification on LIBRARY_PATH environment variable which is much tedious and cumbersome.

So to run the program which needs lots of dependency on other libraries I would prefer Cigwin over minGW.

References

http://www.mingw.org/wiki/HOWTO_Specify_the_Location_of_External_Libraries_for_use_with_MinGW#comment-278.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

RizviHasan
Software Developer
Sweden Sweden
No Biography provided

Comments and Discussions

 
GeneralMy vote of 1 PinmemberSelvin11-Oct-12 3:24 
GeneralRe: My vote of 1 PinmemberRizviHasan11-Oct-12 4:46 
GeneralRe: My vote of 1 PinmemberSelvin11-Oct-12 5:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.141216.1 | Last Updated 9 Oct 2012
Article Copyright 2012 by RizviHasan
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid