0

I am thinking of a cross-platform C++ server application that may involve heavy internet traffic and multi-thread intensive calculations. I have read several comparisons about Cygwin and MinGW for cross-platform C++ application. Based on new information on the 5th answer of this StackOverflow question from Kaz, can I say the Cygwin has a better future?

on July 19, 2019, Kaz added the following new information (copied from there):


Plug: Shortly after the LGPL announcement, I started the Cygnal (Cygwin Native Application Library) project to provide a fork of the Cygwin DLL which aims to fix these issues. Programs can be developed under Cygwin, and then deployed with the Cygnal version of cygwin1.dll without recompiling. As this library improves, it will gradually eliminate the need for MinGW.

When Cygnal solves the path handling problem, it will be possible to develop a single executable which works with Windows paths when shipped as a Windows application with Cygnal, and seamlessly works with Cygwin paths when installed in your /usr/bin under Cygwin. Under Cygwin, the executable will transparently work with a path like /cygdrive/c/Users/bob. In the native deployment where it is linking against the Cygnal version of cygwin1.dll, that path will make no sense, whereas it will understand c:foo.txt.


He said: As this library improves, it will gradually eliminate the need for MinGW. What does this really mean?

peterboston
  • 749
  • 1
  • 6
  • 21

1 Answers1

3

I don't think so at all.

First of all I'm no longer considering MinGW, as MinGW-w64 is a much better and more up to date alternative.

Secondly, Cygwin and MinGW-w64 have different goals. Cygwin wants to provide enough Unix/POSIX emulation to compile code that is otherwise hard to port to native Windows. So Cygwin binaries depend on this emulation layer, which means they're not really native Windows as the emulation layer is always there, which also has performance overhead. But MinGW-w64 aims to allow compiling to native Windows binaries. Disadvantage is that not all Unix/Linux/POSIX sources will compile with it (e.g. fork() doesn't exist), but a lot of things do compile and they result in performant native Windows binaries.

Personally I haven't had the need to use Cygwin at all in the past decade. I build everything with MinGW-w64 now. In fact I don't even have MSVC or any other compilers (like Borland or Intel) on my pc.

My advise is always: only use Cygwin if you really have to. Otherwise MinGW-w64, especially in combination with MSYS2 is always your best bet. This is especially true if you plan to build software for commercial distribution. If I would buy software and notice Cygwin DLLs are part of it, that would make me frown and wonder if the software was actually intended for Windows.

While MSYS2 offers a decent MinGW-w64 GCC compiler, I have decided to start the http://winlibs.com/ project to provide my own personal build of MinGW-w64 GCC, and even LLVM/Clang and in the future hopefully many libraries for both native win32 as win64.

In conclusion regarding your question: If you plan to build something that needs to be resource efficient I really recommend you don't take on the performance overhead of Cygwin, but aim for maximum native performance using MinGW-w64 instead.

Brecht Sanders
  • 2,726
  • 1
  • 8
  • 18