Cygwin, Msys, MinGW, Msys2 the difference and connection (turn)

Source: Internet
Author: User
Tags posix

Disclaimer: This article turns to know that if there is an infringement, please inform the deletion. Litux
Links: https://www.zhihu.com/question/22137175/answer/90908473
Source: Know
There are many articles on the Internet to tell the difference between them and the connection, the beginner to see the confused, in the knowledge of this article is very clear, easy to understand.

Before we tell the difference, let's take a look at some of these things in our past life.



Cygwin, the original Cygnus produced (has been acquired by Red Hat), is currently the RedHat name of the project. The purpose of the project is to provide a Unix-like environment (represented by the GNU tool) running on the Windows platform, and for this purpose, Cygwin provides a set of abstract layer DLLs for converting part of the POSIX calls into Windows API calls to implement related functions. The most typical, most basic simulation layer here is the cygwin1.dll. In addition, with the development of Linux system, the current Cygwin has not only provided POSIX compatibility, so it is also incidentally more simulation layer dependency.

Cygwin's directory structure basically copied the look of Linux, but at the same time, it is also compatible with many features of Windows: Most applications use Unix-style paths, Windows ' drive letter is provided to Cygwin using similar mount points, Cygwin can run Cyg Win's application (which relies on the simulation layer) can run the Windows app, and the path passed to the app passes through its simulated layer transformation to ensure that the program runs without errors.

Because its simulation layer achieves quite good Posix compatibility, people try to transplant many important LINUX/BSD applications into the Cygwin, which makes Cygwin more and more powerful and richer. So far, many people directly to the task of porting the Linux application to the Windows platform to Cygwin (of course, this kind of transplant is not native). In fact, at the beginning of the birth of Cygwin, I wanted to compile the Windows application through GCC, because bootstrap gcc and incidentally made a lump of other things, and finally developed into the present.

Summary: Cygwin is a POSIX "subsystem" that runs on the Windows platform, provides a UNIX-like environment under Windows, and provides a set of software that "ported" some Linux applications to the development environment of the Windows platform. As I have often joked, Cygwin is basically the legendary gnu/nt system (against Gnu/linux,gnu/bsd,gnu/hurd).



MinGW, minimalist GNU for WindowsTo develop a development environment for native (32-bit) Windows apps. It mainly provides tools such as GCC, GNU binutils for Win32 applications, and header files equal to the Windows SDK (subset) and library files for MinGW version linker (so, a, etc., not the VC's Lib).

MinGW can replace CL for compiling winSDK-based Windows applications that do not contain MFC, and the compiled app does not rely on third-party simulation layer support, which is run at the most Windows standard MSVCRT (hence the native Windows app). In addition, MinGW also supports other languages supported by GCC.

For these reasons, MinGW is selected as the default compiler for Windows versions by a number of development tools developed on Linux, such as codeblocks, such as devc++.

Summary, MinGW is the GNU toolchain (development environment) for Windows application development, which is typically a native Windows application, although it does not necessarily have to run under Windows systems (the MinGW toolchain is also present in Linux, BSD, and even Cygwin).



MSYS, since the MinGW itself represents only the toolchain, and under Windows, because of that Shi-like cmd, and the accompanying command-line tools are not complete (and uncomfortable), the MinGW developer has created a branch from the older Cygwin that was used to provide Unix-like Environment. But unlike Cygwin's chatty, MSYS is directed at the goal of small and small, so the whole MSYS and MinGW, mainly based on basic Linux tools, size 200M or so, and there is not much capacity for expansion.

MSYS is a companion package for command-line development for the secondary Windows version of MinGW, providing some Unix tools to make MinGW tools easier to use. If you don't like the huge Cygwin, and don't use much, you can try it. But like the full experience, do not care about disk occupancy and so on, or recommend Cygwin instead of MSYS.



Mingw-w64, the MinGW mentioned earlier, was developed for 32-bit Windows applications. And because of the version issue, the newer Windows APIs are not well supported. MINGW-W64 is a new generation of MinGW that supports more APIs, supports 64-bit application development, and even supports 32-bit host compilation of 64-bit applications and, conversely, "Cross" compilation. In addition, it also has 32-bit and 64-bit versions, and the others are the same as MinGW.



MSYS2, because MinGW years do not update, MSYS more is, Cygwin many new features MSYS not synchronized, so Alex and others set up a new generation of MSYS project. Still fork the Cygwin (newer version), but there is a better Package Manager Pacman, there are active developers and user groups, there are a lot of precompiled packages (although certainly not Cygwin many) ... For users who do not like the huge Cygwin, it is recommended to try Msys2.



Difference (summary): Cygwin is analog POSIX system, source code porting Linux application to Windows; MinGW is the development environment for developing Windows apps.
Contact: All provide some applications under Linux, run more on Windows, MinGW as a package under Cygwin, can run on Cygwin.

Cygwin, Msys, MinGW, Msys2 the difference and connection (turn)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.