[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
./getopt.h:195: error: redefinition of 'struct option'
From: |
Richard W.M. Jones |
Subject: |
./getopt.h:195: error: redefinition of 'struct option' |
Date: |
Fri, 4 Jun 2010 12:26:05 +0100 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
make[4]: Entering directory `/home/rjones/d/libguestfs/gnulib/lib'
CC xstrtol.lo
In file included from xstrtol.h:23,
from xstrtol.c:32:
./getopt.h:195: error: redefinition of 'struct option'
In file included from xstrtol.h:23,
from xstrtol.c:32:
./getopt.h:241: error: conflicting types for 'getopt_long'
/usr/include/getopt.h:175: note: previous declaration of 'getopt_long' was here
./getopt.h:245: error: conflicting types for 'getopt_long_only'
/usr/include/getopt.h:179: note: previous declaration of 'getopt_long_only' was
here
make[4]: *** [xstrtol.lo] Error 1
This is a very bizarre error because I have two machines:
- identical libguestfs from git
- identical gnulib submodule (74d509383fe30bb5511)
- identical glibc (glibc-2.12.90-2)
The only difference is that one machine is i686 -- it fails on this
machine.
The other machine is x86_64 and it compiles fine.
'struct option' declaration is completely identical between glibc
and gnulib.
'getopt_long' and 'getopt_long_only' are slightly different (see the
additional _GL_ARG_NONNULL and possibly in whatever
__getopt_argv_const expands to).
In glibc:
#ifndef __need_getopt
extern int getopt_long (int ___argc, char *const *___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind)
__THROW;
extern int getopt_long_only (int ___argc, char *const *___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind)
__THROW;
#endif
In gnulib:
#ifndef __need_getopt
extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind)
__THROW _GL_ARG_NONNULL ((2, 3));
extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind)
__THROW _GL_ARG_NONNULL ((2, 3));
#endif
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages. http://et.redhat.com/~rjones/libguestfs/
See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
- ./getopt.h:195: error: redefinition of 'struct option',
Richard W.M. Jones <=