bug-gnulib
[Top][All Lists]
Advanced

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

Re: ./lib/getopt.h:197: error: redefinition of `struct option'


From: Eric Blake
Subject: Re: ./lib/getopt.h:197: error: redefinition of `struct option'
Date: Tue, 06 Dec 2011 06:56:19 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0

On 12/06/2011 04:58 AM, Mark R Bannister wrote:
> Hi,
> 
> I'm banging my head against a wall here trying to port nss_db to Solaris 10.
> 
> It includes a source file called makedb.c that requires argp.h and error.h. 
> Incidentally it also requires a Berkeley database which I have in
> /opt/csw/bdb48/include/db.h.
> 
> I thought the easiest thing was to use gnulib to provide the missing argp and
> error functionality.  I couldn't get the git repo (firewall restrictions), so 
> had
> to grab the latest package from here: 
> http://erislabs.net/ianb/projects/gnulib/
> 
> Unfortunately, by importing these gnulib modules I get a new unistd.h that
> includes getopt.h.  The Solaris package SUNWhea also has getopt.h, and now the
> problems really start.

Gnulib getopt should work just fine alongside SUNWhea, if you use it
correctly.

> 
> I imported:
> ./gnulib-tool --import argp error
> and set-up the pre-requisites in configure.in and Makefile.am.
> 
> Here is a very simple test file:
> 
> #include <db.h>

There's your problem.  You have to #include <config.h> prior to any
other include files, if you want gnulib's getopt replacements to work.

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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