[Sussex] Unable to compile - elements of array `long_options' have incomplete type
Matthew Macdonald-Wallace
matthew at truthisfreedom.org.uk
Tue Sep 27 07:01:52 UTC 2005
Jim,
Jim Nicholson wrote:
> Matthew Macdonald-Wallace wrote:
>
>> I'm having issues compiling Silky (http://silky.sourceforge.net/).
>> Basically, I get the following error when I'm compiling:
>>
>> main.c: In function `main':
>> main.c: 512: error: elements of array `long_options' have incomplete type
>> main.c: 513:warning: excess elements in struct initializer
>> main.c: 513:warning: (near initialization for `long_options[0]')
>
>
> You don't say what version of silky you're building or on which
> distribution.
Oops, My bad, I apologise. I'm using the same versions of silky and
silc-toolkit that you are using and I'm running a customised version of
Damn Small Linux (Its based on debian).
> I've downloaded silky-0.5.4 and silc-toolkit-0.9.12 source tarballs onto
> my Mandriva 2005 LE x86 box.
>
> In silc-toolkit-0.9.12 I did the usual
>
> ./configure
> make
> sudo make install
>
> which put the files in /usr/local/silc
>
> In silky-0.5.4 I did
>
> ./configure
>
> which complained it could not find the silc.pc
>
> did a
> find /usr -name silc.pic
> and
> find ~/build_area/silc-toolkit-0.9.12 -name silc.pic
>
> but got no results, so I checked the silky website and did
>
> ./configure --with-silc-libs=/usr/local/silc/lib
> --with-silc-include=/usr/local/silc/include
> make
>
> this aborted with unresolved references when linking, but it did compile
> main.c, you're offending lines are:
>
> static struct option long_options[] = {
> {"debug", 0, 0, 0},
> {"debug-level", 1, 0, 0},
> {0, 0, 0, 0}
> };
>
> (BTW If you had posted these lines I would not have had to go through
> the rigmarole above)
My Bad, I should have done this. :(
> The error you are getting is because the compiler cannot find a
> definition for "struct option". A quick grep in the silky src directory
> found nothing, but grepping in /usr/local/silc/include turns it up in
> getopt.h
>
> So, either
>
> 1) you didn't install silc correctly
> 2) you have a silc.pc which is wrong (assuming that it is some kind of
> script defining the paths to things)
> 3) you passed the wrong path to configure
> 4) you had errors from configure but tried to compile anyway.
OK, thanks, I'll try these out.
Cheers,
Matt
More information about the Sussex
mailing list