tags:

views:

328

answers:

2

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.

+1  A: 

Does this link answer your question?

It's the first result in Google search for mno-cygwin.

Employed Russian
That's the newsgroup posting I was referring to in the question (the posting is from 1999).
Colin
+1  A: 

The -mno-cygwin flag 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.

greyfade