Mail Archives: cygwin/2001/09/28/09:55:57
Thanks, Gerrit. Both of your suggestions needed to be implemented for rsync
to compile cleanly.
Make error when getopt.h is not patched:
Administrator AT AMC-OVREPORT /home/tfong/rsync2.4.6
$ make
gcc -I. -I. -O -c rsync.c -o rsync.o
In file included from /usr/include/unistd.h:7,
from rsync.h:87,
from rsync.c:23:
/usr/include/getopt.h:41: redefinition of `struct option'
/usr/include/getopt.h:56: conflicting types for `getopt_long'
lib/getopt.h:107: previous declaration of `getopt_long'
make: *** [rsync.o] Error 1
--> getopt.h version 1.3 was downloaded from Cygwin's CVS to replace
/usr/include/getopt.h
After getopt.h is patched to version 1.3, make produces this error:
Administrator AT AMC-OVREPORT /home/tfong/rsync2.4.6
$ make
gcc -I. -I. -O -c rsync.c -o rsync.o
In file included from /usr/include/unistd.h:7,
from rsync.h:87,
from rsync.c:23:
/usr/include/getopt.h:41: redefinition of `struct option'
make: *** [rsync.o] Error 1
--> /usr/include/unistd.h was replaced with your patched version included in
this thread
The rsync 2.4.6 code produced peer reset errors when trying to obtain a
module listing. This is corrected with patches supplied in rsync bug track
ID 3236 provided by Jonathan Kamens <jik AT curl DOT com>.
Thanks again for your help!
Cheers,
\\TF.
-----Original Message-----
From: Gerrit P. Haase
To: Ted Fong
Cc: cygwin AT cygwin DOT com
Sent: 9/20/01 5:50 PM
Subject: Re: Compile error with rsync-2.4.6 and latest Cygwin
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/
- Raw text -