delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/05/06/21:49:37

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <48210A92.6A9674F6@dessent.net>
Date: Tue, 06 May 2008 18:49:06 -0700
From: Brian Dessent <brian AT dessent DOT net>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
MIME-Version: 1.0
To: Mark <mark_h74 AT hotmail DOT com>
CC: cygwin AT cygwin DOT com
Subject: Re: Newbie needs help using mingw with cygwin
References: <loom DOT 20080506T012312-150 AT post DOT gmane DOT org> <E1JtC2R-0006lX-F2 AT ciao DOT gmane DOT org> <BLU145-W2465742F9F668F6A6E4FBCEED60 AT phx DOT gbl> <20080506231036 DOT GA27910 AT ednor DOT casa DOT cgf DOT cx> <loom DOT 20080506T232849-171 AT post DOT gmane DOT org> <20080506235700 DOT GA28066 AT ednor DOT casa DOT cgf DOT cx> <loom DOT 20080507T002123-723 AT post DOT gmane DOT org>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Mark wrote:

> 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
other.

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
expect.

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.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019