<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jul 5, 2020 at 4:00 PM Bruno Haible via cfarm-users <<a href="mailto:cfarm-users@lists.tetaneutral.net">cfarm-users@lists.tetaneutral.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Jeffrey,<br>
<br>
> b2sum-src/b2sum.c:266:26: error: array type has incomplete element<br>
> type 'struct option'<br>
> static struct option long_options[] = {<br>
> ^~~~~~~~~~~~<br>
<br>
When you use 'struct option', you need to<br>
<br>
1) use Gnulib module 'getopt-gnu' - see the documentation<br>
<a href="https://www.gnu.org/software/gnulib/manual/html_node/getopt.html" rel="noreferrer" target="_blank">https://www.gnu.org/software/gnulib/manual/html_node/getopt.html</a><br>
<a href="https://www.gnu.org/software/gnulib/manual/html_node/getopt_002eh.html" rel="noreferrer" target="_blank">https://www.gnu.org/software/gnulib/manual/html_node/getopt_002eh.html</a><br>
<a href="https://www.gnu.org/software/gnulib/manual/html_node/getopt_005flong.html" rel="noreferrer" target="_blank">https://www.gnu.org/software/gnulib/manual/html_node/getopt_005flong.html</a><br>
<br>
2) #include <getopt.h>, not <unistd.h> - see the documentation<br>
<a href="https://www.gnu.org/software/gnulib/MODULES.html#module=getopt-gnu" rel="noreferrer" target="_blank">https://www.gnu.org/software/gnulib/MODULES.html#module=getopt-gnu</a><br>
<br>
Bruno<br></blockquote><div><br></div><div>And getopt(3) with long options is a GNU extension implemented by glibc, some</div><div>other libc also provides similar interfaces (such as FreeBSD with getopt_long).</div><div><br></div><div>However it seems that AIX does not have a similar interface so the best option</div><div>is indeed to use gnulib.<br></div></div><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div>"Tradition is not the worship of ashes, but the preservation of fire."</div><div>- Gustav Mahler</div></div></div></div></div>