This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: impure_ptr/Mingw and cygwin


On Mon, 25 Nov 2002, 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:
> 
> 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

No, the example above is from the command line in which *you* specified
"-I../../include -I/usr/include -I/usr/include/mingw".  If you don't
specify any include directories the default list is:

  /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/include
  /usr/include/mingw
  /usr/include/w32api

I'm afraid the real solution is to file a bug report with the mingw list,
just like Christopher said.  I'm betting there are other functions which
aren't prototyped in headers too.  For your purposes, it's sufficient to
copy the function prototype and the external variable declarations from
getopt.h (or make a symlink in your private ../../include directory).
Developing for a minimal environment has it's price :)

> 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? (Another side question 
> would be why is /usr/include/mingw listed twice?).
> 
> >> In any event, after reading up on this problem in the MingW mailing 
> >> list  I find that I am not the only one with this problem. Seems that 
> >> -liberty  does indeed have the code for getopt but there is no mingw 
> >> header file  that defines the interface. My solution ended up being 
> >> define the getopt  API by hand and put it in my own mksf.h header 
> >> file. Ugly but it works.
> >
> > Did you send a bug report or patch to the mingw mailing list?
> 
> Didn't really want to have to sign up for yet another account on another 
> mailing list, yadda, yadda. It seemed to me that they were aware of the 
> problem already so why should I bother to report a problem that is 
> already known?

But, since that *is* the environment you are building in, it makes sense
to subscribe to that list.  It's a very low traffic list anyways, and it
only takes a few minutes to subscribe.  C'mon, it's for a good cause!

-- 
Peter A. Castro <doctor@fruitbat.org> or <Peter.Castro@oracle.com>
	"Cats are just autistic Dogs" -- Dr. Tony Attwood


--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]