bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ./getopt.h:195: error: redefinition of 'struct option'


From: Bruno Haible
Subject: Re: ./getopt.h:195: error: redefinition of 'struct option'
Date: Fri, 4 Jun 2010 15:16:38 +0200
User-agent: KMail/1.9.9

Richard W.M. Jones wrote:
>         /bin/sh ../../libtool  --tag=CC   --mode=compile gcc -std=gnu99 
> -std=gnu99 -DHAVE_CONFIG_H -I. -I../..     -g -O2 -MT xstrtol.lo -MD -MP -MF 
> $depbase.Tpo -c -o xstrtol.lo xstrtol.c &&\

This command line is line.

> >   2)   the contents of config.h
> 
> Attached.

Fine as well.

> >   1)   grep GETOPT config.status
> 
> $ grep GETOPT config.status 
> S["GETOPT_H"]=""

So, gnulib has determined that it does not need to use its own 'getopt.h'
replacement.

> gcc -std=gnu99 -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -g -O2 -MT xstrtol.lo 
> -MD -MP -MF .deps/xstrtol.Tpo -dD -E xstrtol.c  -fPIC -DPIC > 
> xstrtol-preproc.i
> 
> http://www.annexia.org/tmp/xstrtol-preproc.i

This contains:

# 106 "/usr/include/getopt.h" 3 4
struct option
{
  const char *name;


  int has_arg;
  int *flag;
  int val;
};

and

# 194 "./getopt.h" 3
struct option
{
  const char *name;


  int has_arg;
  int *flag;
  int val;
};

The first one is fine. The second one should not be there.

Conclusion: You had a getopt.h that was necessary for one platform, and you
transported it to another platform where it is not needed.

You need to do "make distclean" before copying code to another platform,
or reconfiguring under different conditions. Or build in separate directories
(VPATH builds), if you prefer that.

> The results below are after 'rm config.h; ./configure ...; make clean'

It's good habit to always do "make -k distclean" before reconfiguring.

Bruno



reply via email to

[Prev in Thread] Current Thread [Next in Thread]