Msys/mingw and CYGWIN/GCC

Source: Internet
Author: User

First, MinGW

MinGW official website for http://www.mingw.org/

MinGW, minimalist GNU for Windows (GCC compiler Suite). It is a collection of header files and port libraries that allow people to use GCC (GNU Compiler C) to generate WINDOWS32 programs without a third-party dynamic link library.

MinGW: A free-to-use and free-to-publish Windows-specific header file and a collection of import libraries using the GNU toolset, at the basic level, MinGW is a set of include files and port libraries, Its function is to allow the console mode of the program to use Microsoft's standard C run time library (MSVCRT.DLL), which is valid on all NT OS, in all Windows 95 releases above the Windows OS valid, using the basic runtime, you can use the GCC Write console mode compliant The American Standardization Organization (ANSI) program, which can use the C run-time extension provided by Microsoft. This feature is not available with the Windows32 API. The next component is the W32API package, which is a set of include files and port libraries that can be used with the Windows32 API. Combined with the basic runtime, you can have full rights to use both the CRT (C runtime) and the WINDOWS32 API functionality.

In fact, MinGW is not just a C + + compiler, but a set of GNU tools. In addition to the GCC (GNU Compiler Collection), MinGW also contains some other GNU program development tools (such as gawk bison, etc.).

The MinGW was developed to provide a GNU-compliant GNU working environment for those who do not like to work on the Linux (FreeBSD) operating system and remain in Windows. So, using MinGW, we can use the GNU Program development tool just like under Linux.

GCC is the core of MinGW, and GCC is a set of compiler systems that support a wide range of computer programming languages, and are closest to the standard in the implementation of language standards. And GCC can be ported to almost all available computer platforms today.

GCC itself does not have an IDE interface like VC (but there are many open source ides that support the use of MinGW, such as codeblocks,eclipse, etc.). Source code editing You can choose any text editor you like (it is said that Microsoft developers, including VC development are not using the VC IDE Editor, but the GNU VIM editor). Then use tools such as make to compile, link, package, and even publish software projects. And like the CVS (SVN) Source version Control tool, people in any corner of the world can get involved in a software project.

About MFC, the Microsoft Foundation Library class, this with VC + + carried a source code open development package, and other Windows program development package is the same. If you have VC + + authorization, you can fully use the source code of MFC, that is, you use GCC to compile MFC program is completely possible.

Of course, there are many Windows program development packages under GNU, even some of which are supported across platforms. It is not only possible to compile the source code directly into a Windows program, but also to compile the graphics program into other operating systems without modification.

Second, MSYS

Official website for http://www.mingw.org/

Msys:unix-like command line utilities, including basic bash, make, gawk and grep, and more. It is also common to think of small Unix on Windows. Provides the emulation UNIX environment on Windows to use MinGW.

msys-cn:http://code.google.com/p/msys-cn/

Msys China release, develop Windows programs with the UNIX development environment.

Msys simulates a Unix-like terminal under Windows, which provides only mingw user loading environments and uses MinGW in Msys simulated UNIX environments, just like using GCC on UNIX.

Third, CYGWIN/GCC

CYGWIN/GCC and MinGW are all GCC's compilation environments under Windows, but what is the difference between these two compilers in real-world work.

CYGWIN/GCC can be fully and in the GCC under Linux equals, this can be seen from the division of the Boost library, Cygwin under the GCC and the Linux under the GCC fully use the same toolsets. So it's perfectly possible to update the GCC version in sync with Linux without worrying about the problem, and what CYGWIN/GCC does (without Win32) can be used seamlessly under Linux without any problems. is a good choice for developing Linux programs under Windows.

However, the program compiled under CYGWIN/GCC must rely on cygwin1.dll for Windows execution, and it is a bit slow, and if you do not want to rely on this thing, you must add-mno-cygwin to the GCC compilation options. In fact, the GCC compiler will automatically choose to install CYGWIN/GCC when installing the MinGW, this mingw is a cross-compilation of GCC.

For MinGW as an implementation of GCC on windows, because unlike Cygwin's GCC runs on an emulated Linux and quite a few of the Linux tools are not available, there are now msys the shell that simulates Unix, Can solve a lot of problems.

Iv. Summary

MinGW is a Windows version of the GCC collection and does not need to rely on the middle tier.

Msys is a simulation of a small Linux environment that can be combined with MINGW to simulate the use of MinGW gcc in a Linux environment.

Cygwin is a powerful Linux environment due to the fact that cygwin1.dll implements the conversion of the underlying Windows API to the Linux API. So developing in Cygwin is equivalent to developing on Linux, which is equivalent to calling the Linux type API for developers, so the developed program can also be ported directly to Linux. But if such a program is to be executed on Windows, the runtime must cygwin1.dll support.

Based on the above analysis, if you are developing Linux cross-platform programs in Windows, the Linux emulator Cygwin and the included gcc are good choices, but the program you develop must rely on a cygwin1.dll. If you just want to use the GCC compiler under windows and don't want to rely on other dll,mingw, it's a good choice.

Msys/mingw and CYGWIN/GCC

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.