Menu

#1 main.c doesn't compile

open
nobody
None
5
2006-03-24
2006-03-24
Unavowed
No

main.c:921: error: elements of array `options' have
incomplete type

Solution: just #include <getopt.h> in main.c

Discussion

  • Unavowed

    Unavowed - 2006-03-25

    Logged In: YES
    user_id=503368

    Actually, the correct way to do it seems to be #include
    <unistd.h> instead of #include <getopt.h>, which might be
    glibc-specific.

    The system I encountered this error on was gentoo, gcc+glibc.

     
    • Stefan Haubenthal

      Sorry, getopt_long is not POSIX, so your first solution was okay. How about this?

      --- main.c.bak  2005-01-12 23:00:58.000000000 +0100
      +++ main.c  2018-04-21 00:01:58.000000000 +0200
      @@ -38,9 +38,7 @@
       #include "game2bin.h"
       #include "animation.h"
      
      -#ifdef WIN32
       #include "getopt.h"
      -#endif
      
       static char *VERSION = "1.2.2";
      
       

      Last edit: Stefan Haubenthal 2018-04-20

Log in to post a comment.

MongoDB Logo MongoDB