delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/11/25/20:57:21

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Date: Mon, 25 Nov 2002 20:57:18 -0500
From: Christopher Faylor <cgf-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Cc: ADeFaria AT Salira DOT com
Subject: Re: impure_ptr/Mingw and cygwin
Message-ID: <20021126015718.GA14178@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com, ADeFaria AT Salira DOT com
References: <Pine DOT LNX DOT 4 DOT 21 DOT 0211251615350 DOT 7231-100000 AT gremlin DOT fruitbat DOT org> <3DE2C59A DOT 9030103 AT Salira DOT com> <20021126012120 DOT GC13548 AT redhat DOT com> <3DE2D193 DOT 9040906 AT Salira DOT com>
Mime-Version: 1.0
In-Reply-To: <3DE2D193.9040906@Salira.com>
User-Agent: Mutt/1.5.1i

On Mon, Nov 25, 2002 at 05:42:43PM -0800, Andrew DeFaria wrote:
>Christopher Faylor wrote:
>
>>[one more for the archives]
>>On Mon, Nov 25, 2002 at 04:51:38PM -0800, Andrew DeFaria wrote:
>>
>>>If this were really so then why, if I don't specify -I/usr/include I 
>>>get  getopt.h not found?!? I should be found in /usr/include/getopt.h no?
>>
>>/usr/include is for cygwin apps. If you add -I/usr/include you subvert 
>>the normal operation of -mno-cygwin by including cygwin-only header 
>>files which is *specifically* what -mno-cygwin is avoiding. The system 
>>include area for -mno-cygwin is /usr/include/mingw.
>
>Understood, however Peter did say:
 ^^^^^^^^^^
Apparently not.

>If you add the "-v" flag to you compile flags, gcc will dump the list of 
>directories it searches for include files.  In this case it would be:
>
>../../include
>/usr/include/mingw
>/usr/include
>/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include
>/usr/include/mingw
>/usr/include/w32api

Because the compiler options specified included -I/usr/include.  He was
responding to your question about "why am i getting this warning".  Your
command line looked like this:

> /bin/gcc -c -g -mno-cygwin -I. -I../../include -I/usr/include/mingw -I/usr/include -DCYGWIN mksf.c
>                                                                        ^^^^^^^^^^^^

>So mine was more of a question: If as Peter says /usr/include is the 3rd 
>library searched, why isn't getopt.h being found?

In the example that you specified there was no hint that it wasn't
found.  In fact, you said "this works" (sic).  You were asking
about a warning.

>(Another side question would be why is /usr/include/mingw listed
>twice?).

You specified -I/usr/include/mingw on the command line and it is already
included by default when you use -mno-cygwin.

Let me say it again.  If you want to compile a windows-only app, you
just use -mno-cygwin.  If you find that some function is missing when
you do this, that means that the function is likely missing from the
mingw distribution.  The solution in this case is not to link in the
bits that you need from cygwin directories.  -mno-cygwin is supposed to
be a world by itself.  You usually can't mix it with cygwin bits and get
anything useful.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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