3 ms·
MinGW is not getting more and more mature, because it keeps depending on the same library from Microsoft. That library is the big downer in MinGW. MinGW is now
by kazinator 10y ago
MinGW is not getting more and more mature, because it keeps depending on the same library from Microsoft. That library is the big downer in MinGW. MinGW is now dead as a way of doing quick-and-dirty ports of POSIX programs to Windows. (Specifically, quick and dirty porting of non-GPL-ed programs to Windows, such as they are not tainted by the GPL).
Going forward, MinGW is only useful for writing Windows-only programs using GCC, GNU Make and Bash. Well, sort of. Anyone in their right mind will just download a copy of Visual Studio if they want to write Windows programs in C or C++.
MinGW still has a tiny advantage: its path handling is more Windows-like. Cygwin programs do not understand the concept of each drive letter having its own current directory, so that drive-letter-qualified relative paths are possible. A drive relative path like "C:foo/bar/txt" does not work properly in Cygwin. What it is supposed to do is resolve against the current directory that is associated with the C: drive. I think what happens is that it gets treated as "C:/foo/bar.txt". If you compile a command line utility with Cygwin, and that utility works with path arguments, it will surprise Windows users in some circumstances. Perhaps Cygwin can fix this issue someday (if it hasn't already; I haven't been tracking this).
- smhenderson 10y agoCygwin handles the drive letter situation using a special directory under it's root called cygdrive. Each drive letter is exposed as a sub directory of it so in your example the path is: /cygdrive/c/foo/bar.txt Not saying it's any prettier but that's how they do it. Not sure how they do this but thankfully it doesn't nest recursively. Say you install cygwin on your C: drive. If you do "cd /cygdrive/c/cygwin" and then ls you'll see cygdrive as a directory entry but if you cd into it and ls again there are no drive letters. The only place the drive letter directories are exposed is directly under /cygdrive.
- kazinator 10y agoI seem to recall that once upon a time, only the /cygdrive convention worked in Cygwin. But for years now, Cygwin has supported supported drive letter prefixes, as in c:/foo/bar.txt. Thus, effectively, /cygdrive/c can be regarded as a legacy hack. Sort of. If you do "cd c:" you end up with "/cygdrive/c" as your current working directory. Backslashes work fine, too; try "ls c:\\temp".
- smhenderson 10y agoHey, thanks, I did not know that and I use cygwin a lot. I guess that explains why my comment was voted down.
- jen20 10y agoMinGW is particularly useful as part of a cross compilation chain for Windows targeting the native Windows APIs. That way you don't have to run Windows as part of a CI process.
- kazinator 10y agoI wrote: > keeps depending on the same library from Microsoft. It's actually worse. What I didn't understand it that it depends on an internal library which Microsoft says applications aren't supposed to use! See informative comment by geofft: https://news.ycombinator.com/item?id=11964589 https://news.ycombinator.com/item?id=11964589 Oops!