I have recently discovered that I can make windows executables with g++ that have no external dependencies, as long as I use the -mno-cygwin flag. My impression is that the compiler uses MinGW libraries instead of cygwin.
-
Is this an effective way of using cygwin to build binaries without gpl licensing issues?
-
Are there any technical side effects of this besides a larger executable? (i.e., loosing cygwin-specific features, restricted functionality)
-
Is this feature documented anywhere? I can only find newsgroup postings from several years ago describing it.
The
-mno-cygwinflag removes all dependencies on Cygwin so that your program will not rely on cygwin1.dll, nor on the presence of a Unix environment. The resulting executable is as if it had been compiled with the MinGW toolchain rather than Cygwin. Standard functions won’t recognize or understand Unix-style paths or symlinks as they are implemented in Cygwin.I can’t remember where it is, but there is a help document within Cygwin that explains it.