Subject: Re: Compile error with rsync-2.4.6 and latest Cygwin
From: "Gerrit P. Haase" <[email-masked]>
To: Ted Fong <[email-masked]>
Cc: [email-masked]
Date: Thu, 20 Sep 2001 23:50:51 +0200

Ted Fong schrieb am 2001-09-20, 16:02:

>Hello,
>
>My environment is NT 4.0 with the version of Cygwin downloaded 2001Sep20
>(see cygcheck output below).  Install of Cygwin was "default" - no changes
>to environment settings.
>
>Receiving this error when compiling rsync-2.4.6:
>
>$ make
>gcc -I. -I. -O -c lib/getopt.c -o lib/getopt.o
>lib/getopt.c: In function `getopt_long':
>lib/getopt.c:672: argument `argv' doesn't match prototype
>/usr/include/getopt.h:56: prototype declaration
>lib/getopt.c:672: argument `options' doesn't match prototype
>/usr/include/getopt.h:56: prototype declaration
>lib/getopt.c:672: argument `long_options' doesn't match prototype
>/usr/include/getopt.h:56: prototype declaration
>make: *** [lib/getopt.o] Error 1

/usr/include/getopt.h should not be included if you don't have 
the cygwin getopt_long version patched.

I got another error, because lib/getopt.h gets included and then
/usr/include/getopt/h gets included by unistd.h.

I have my unistd.h patched because it is causing trouble since lots 
of packages contains their own getopt.c / getopt.h like rsync, too.

Now Have you logged the output of configure?
There should be included this line: 
 checking for working getopt_long... no

Now if that is the case, lib/getopt.h gets included.

Here is how i patched /usr/include/unistd.h to get around 
this problem:

/* unistd.h for Cygwin. */

#ifndef _UNISTD_H_
#define _UNISTD_H_

# include <sys/unistd.h>
#if !defined(__GETOPT_H__) && !defined(_GETOPT_H)
# include <getopt.h>
#endif

#endif /* _UNISTD_H_ */

Ciao,

Gerrit

-- 
=^..^=

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