eclipse MinGW 还是 Cygwin GCC?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13503533/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
MinGW or Cygwin GCC?
提问by tonga
I want to install a GCC compiler in Windows for the Eclipse IDE. I know there are two options: MinGW GCC or Cygwin GCC. Which one is better for Eclipse CDT? Any experience or suggestions will be appreciated.
我想在 Windows 中为 Eclipse IDE 安装 GCC 编译器。我知道有两种选择:MinGW GCC 或 Cygwin GCC。哪个更适合 Eclipse CDT?任何经验或建议将不胜感激。
回答by wardd
Using Cygwin means your program will be dependent on cygwin1.dll
, which is essentially a layer that allows POSIX functionality to be used in a Windows environment. Compiling with the standard MinGW GCC provides no such dependancy. This means however, if you intend to compile with MinGW GCC, you will not have access to POSIX functions such as fork()
and exec()
.
使用 Cygwin 意味着您的程序将依赖于cygwin1.dll
,它本质上是一个允许在 Windows 环境中使用 POSIX 功能的层。使用标准 MinGW GCC 进行编译不提供这种依赖性。然而,这意味着,如果您打算使用 MinGW GCC 进行编译,您将无法访问 POSIX 函数,例如fork()
和exec()
。
For more information on the differences between Cygwin and MinGW, see here.
有关 Cygwin 和 MinGW 之间差异的更多信息,请参见此处。
回答by earl3s
Personally I like Cygwin better, it has a lot of installation options and it feels a lot like the terminal you'll find on a Linux machine. It provides a pretty substantial set of Linux-like capabilities, something that Windows fails at miserably.
我个人更喜欢 Cygwin,它有很多安装选项,感觉很像您在 Linux 机器上找到的终端。它提供了一组相当丰富的类似 Linux 的功能,而 Windows 却在这方面惨遭失败。
回答by PersianGulf
Wikipedia Says:
维基百科说:
MinGW
forked from version 1.3.3 of Cygwin
. Although both Cygwin
and MinGW
can be used to port UNIX
software to Windows
, they have different approaches: Cygwin
aims to provide a complete POSIX layer
that provides emulations of several system calls and libraries that exist on Linux
, UNIX
, and the BSD
variants. The POSIX layer
runs on top of Windows
, sacrificing performance where necessary for compatibility. Accordingly, this approach requires Windows
programs written with Cygwin
to run on top of a copylefted compatibility library that must be distributed with the program, along with the program's source code
. MinGW
aims to provide native functionality and performance via direct Windows API calls
. Unlike Cygwin
, MinGW
does not require a compatibility layer DLL
and thus programs do not need to be distributed with source code
.
MinGW
从 1.3.3 版分叉出来Cygwin
。虽然两者Cygwin
并MinGW
可以用于端口UNIX
的软件Windows
,它们有不同的方法:Cygwin
旨在提供一个完整的POSIX layer
,它提供的几个系统调用,并且存在于库仿真Linux
,UNIX
和BSD
变种。在POSIX layer
之上运行Windows
,牺牲性能在必要的兼容性。因此,这种方法要求Windows
编写的程序Cygwin
运行在必须与程序一起分发的 Copyleft 兼容库之上,以及程序的source code
. MinGW
旨在通过直接提供本机功能和性能Windows API calls
。不像Cygwin
,MinGW
不需要兼容层DLL
,因此程序不需要与source code
.
Because MinGW
is dependent upon Windows API calls
, it cannot provide a full POSIX API
; it is unable to compile some UNIX applications
that can be compiled with Cygwin
. Specifically, this applies to applications that require POSIX
functionality like fork()
, mmap()
or ioctl()
and those that expect to be run in a POSIX environment
. Applications written using a cross-platform library
that has itself been ported to MinGW
, such as SDL
, wxWidgets
, Qt
, or GTK+
, will usually compile as easily in MinGW
as they would in Cygwin
.
因为MinGW
是依赖Windows API calls
,所以不能提供完整的POSIX API
;它无法编译一些UNIX applications
可以用Cygwin
. 具体而言,这适用于需要的应用程序POSIX
一样的功能fork()
,mmap()
或ioctl()
和那些希望在运行POSIX environment
。使用cross-platform library
本身已被移植到的a 编写的应用程序MinGW
,例如SDL
, wxWidgets
, Qt
, or GTK+
,通常会像在 中MinGW
一样容易编译Cygwin
。
The combination of MinGW
and MSYS
provides a small, self-contained environment that can be loaded onto removable media without leaving entries in the registry or files on the computer. Cygwin
Portable provides a similar feature. By providing more functionality, Cygwin
becomes more complicated to install and maintain.
的组合MinGW
,并MSYS
提供了一个可以装载到可移动媒体不留在计算机上的注册表项或文件小,独立的环境。Cygwin
便携式提供了类似的功能。通过提供更多功能,Cygwin
安装和维护变得更加复杂。
It is also possible to cross-compile Windows applications
with MinGW-GCC under POSIX systems
. This means that developers do not need a Windows installation with MSYS
to compile software that will run on Windows
without Cygwin
.
也可以cross-compile Windows applications
与MinGW-GCC under POSIX systems
. 这意味着开发人员无需安装 WindowsMSYS
即可编译Windows
无需Cygwin
.
回答by chill
Cygwin and Mingw are not interchangeable alternatives. Cygwin is used to compile POSIX API programs, Mingw is used compile Windows API programs.
Cygwin 和 Mingw 不是可互换的替代品。Cygwin 用于编译 POSIX API 程序,Mingw 用于编译 Windows API 程序。
Chose one or the other depending on what kind program you're going to write.
根据您要编写的程序类型选择其中一种。
回答by Gibbon1
My offhand thoughts are, if you need cygwin, you need it. For instance compiling programs that were developed for Unix and have symbolic links and shell scripts in the build system.
我的想法是,如果你需要 cygwin,你就需要它。例如,编译为 Unix 开发并在构建系统中具有符号链接和 shell 脚本的程序。
If you don't need it, you don't want it. And compiling under linux on a virtual machine is often a better choice than going the cygwin route.
如果你不需要它,你就不想要它。在虚拟机上在 linux 下编译通常比走 cygwin 路线更好。
So mingw is perfectly fine. Works fine, simple to use.
所以mingw完全没问题。工作正常,使用简单。
Also: You might consider codelite (www.codelite.org) instead of Eclipse.
另外:您可能会考虑使用 codelite (www.codelite.org) 而不是 Eclipse。