This is the mail archive of the
mailing list for the Cygwin project.
Re: Newbie needs help using mingw with cygwin
> At the moment I'm out of my depth with the whole cygwin mingw stuff.
> I had thought that by modifying my etc/profile to pick up mingw istead of the
> GCC bundled in cygwin I would still be able to use the cygwin environment but
> just have mingw do the compiling (doing GCC --version in cygwin gives me 4.1).
> The ./configure script checks for the installation of certain programs, after
> changing the etc/profile file it suddenly doesn't find those programs
> I think I'm really not getting it (which included even managing to start a new
> thread when I wanted to reply to one, great!), I don't understand why the
> configure script suddenly doesn't find the programs, I'll have a really good
> look in the forums but suspect I'm going to go to linux to do the builds.
The thing you are missing is that MinGW and Cygwin are very different
platforms. MinGW uses the C runtime library of MS Windows (MSVCRT.DLL)
and provides no POSIX emulation, whereas Cygwin provides its own C
library and does emulate a great deal of POSIX functionality. Because
of this difference the two compilers are not compatible at all -- they
have entirely different header and library search paths, and
objects/librarys built with one cannot be linked to those built with the
You can't expect the MinGW compiler to see any Cygwin headers or
libraries, because it has no idea what /usr/include even means, as it's
a native program with no POSIX emulation. In other words, using the
MinGW compiler will build only native Win32 apps, it cannot be used to
build Cygwin apps or use any Cygwin features or Cygwin headers or Cygwin
libraries. When you run configure with MinGW gcc at the front of PATH,
only features available to MinGW gcc will be detected. What you're
trying to do is fundamentally broken, and just doesn't work the way you
The only way that you can use MinGW gcc is if you want to build a MinGW
version of the package, which may not even be possible if it hasn't been
ported to native Windows. And even if it was, you'd have to also build
MinGW versions of all dependant libraries, as the Cygwin ones are not
usable from a MinGW program. These are two separate and distinct
platforms, you cannot mix and match.
If you really want to use Cygwin as a host to build MinGW (native
windows) programs you need to treat it like cross compiling and specify
"--host=i686-pc-mingw32". But this is most likely NOT what you intended
to accomplish at all in this case.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html