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 X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) MIME-Version: 1.0 To: Mark CC: cygwin AT cygwin DOT com Subject: Re: Newbie needs help using mingw with cygwin References: <20080506231036 DOT GA27910 AT ednor DOT casa DOT cgf DOT cx> <20080506235700 DOT GA28066 AT ednor DOT casa DOT cgf DOT cx> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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/