Cygwin/GCC and mingw

Source: Internet
Author: User

Cygwin/GCC and mingw are both GCC compiling environments in windows, but what are their differences? In actual work, how can we choose the two compilers?

Cygwin/GCC can be fully equal to the GCC in Linux, which can be seen from the boost Library Division, GCC in cygwin and GCC in Linux use the same toolsets.
Therefore, you can synchronize the GCC version with Linux without worrying about any problems. What you do in cygwin/GCC (not Win32) can be seamlessly used in Linux, no problem. Is to develop Linux in WindowsProgramIs a good choice. However, for programs compiled in cygwin/GCC, cygwin1.dll must be executed in windows, and the execution speed is slow. If you do not want to depend on this program, -MnO-cygwin must be added to the GCC compilation options. When this option is added, the GCC compiler automatically selects the mingw installed when cygwin/GCC is installed. This mingw is a cross-Compilation of GCC.

Note: Cross-compilation is an important technology in embedded development. Its main feature is the Program executed on a machine.CodeIt is not compiled and generated on the local machine, but compiled by another machine. Generally, the former is called the target machine, and the latter is called the host machine. The main reason for cross-compilation is that most embedded target systems cannot provide sufficient resources for the compilation process, so they have to transfer the compilation project to a high-performance host.

Mingw is an implementation of GCC on Windows. Because it does not run on a simulated Linux like cygwin's GCC, a considerable number of Linux tools cannot be used, however, msys, a Unix-simulated shell, can solve many problems, but it is not easy to use cygwin. The no-cygwin option of cygwin/GCC depends on mingw's support, therefore, updates are slower, but only to 3.3.3. GCC can also be upgraded under mingw, but msys is required. The upgrade method is similar to that in cygwin & Linux, so it is no longer cool. However, it seems that my upgrade experience is not smooth. I have no time to perform the in-depth tests.
It also enables the latest installed GCC of cygwin to support no-cygwin. You need to perform cross-compilation again, but I won't do it, so I have to forget it. Maybe I will fix it that day, open another post.

According to the above analysis, if you develop a Linux program in windows, cygwin is a good choice. If the program you develop does not mind a cygwin1.dll, you can also choose cygwin. Mingw is a good choice if you want to develop programs in windows and use GCC. However, there are too many compilers in windows, such as BC, Vc, and Intel c .....
By the way, it is said that the performance of gcc4.0.0 has been greatly improved. If I upgrade gcc4 and then compile a gcc4, will the compilation performance be improved a lot in the future?
TIPS: Use the command gcc-V to know the current version of GCC installation configuration.

Trackback: http://tb.blog.csdn.net/TrackBack.aspx? Postid = 1476632

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.