Menu

#7 0.6.1 compile error on Cygwin x64

open
nobody
None
5
2016-06-12
2016-06-08
Jari Aalto
No

0.6.1. does not compile under Cygwin. Full build log in attachment.

(...)
In file included from list.c:15:0:
database.h:64:12: warning: inline function 'field_id' declared but never defined
 inline int field_id(int i);
            ^
mv -f .deps/list.Tpo .deps/list.Po
gcc -DHAVE_CONFIG_H -I.   -I/usr/include/ncursesw  -Wall -g -O2 -MT mbswidth.o -MD -MP -MF .deps/mbswidth.Tpo -c -o mbswidth.o mbswidth.c
mbswidth.c:66:5: error: conflicting types for 'wcwidth'
 int wcwidth ();
     ^
mbswidth.c:66:1: note: an argument type that has a default promotion can't match an empty parameter name list declaration
 int wcwidth ();
 ^
In file included from /usr/include/stdlib.h:11:0,
                 from mbswidth.c:33:
/usr/include/wchar.h:130:5: note: previous declaration of 'wcwidth' was here
 int _EXFUN(wcwidth, (const wchar_t));
     ^
1 Attachments

Discussion

  • Raphaël

    Raphaël - 2016-06-12

    Could you please post whether ./configure set HAVE_DECL_WCWIDTH to 1 or 0 inside config.h?
    If, most probably, it sets it to 0, then it's wrong since it should have detected the one from your version of /usr/include/stdlib.h and thus not have a conflicting declaration.

    I'd say check your ./configure exited successfully, and post the lines relatde to wcwidth

     

    Last edit: Raphaël 2016-06-12
  • Jari Aalto

    Jari Aalto - 2016-06-12

    I ran:

    ... automake (GNU automake) 1.14.1
    ... autoconf (GNU Autoconf) 2.69

    $ uname -m
    x86_64

    $ rm configure
    $ automake --add-missing
    $ autoconf -f -i

    few warnings:

    configure.ac:13: warning: The 'AM_PROG_MKDIR_P' macro is deprecated, and its use is discouraged.
    configure.ac:13: You should use the Autoconf-provided 'AC_PROG_MKDIR_P' macro instead,
    configure.ac:13: and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files.

    results:

      $ grep HAVE_DECL_WCWIDTH conf*
      config.h:#define HAVE_DECL_WCWIDTH 0
      config.h.in:#undef HAVE_DECL_WCWIDTH
      config.h.in~:#undef HAVE_DECL_WCWIDTH
      config.log:| #define HAVE_DECL_WCWIDTH 0
      config.log:| #define HAVE_DECL_WCWIDTH 0
      config.log:| #define HAVE_DECL_WCWIDTH 0
      config.log:| #define HAVE_DECL_WCWIDTH 0
      config.log:| #define HAVE_DECL_WCWIDTH 0
      config.log:#define HAVE_DECL_WCWIDTH 0
      config.status:D["HAVE_DECL_WCWIDTH"]=" 0"
      configure:#define HAVE_DECL_WCWIDTH $ac_have_decl
    
      $ grep WCWIDTH /usr/include/stdlib.h
      <empty>
    
      $ grep WCWIDTH /usr/include/*.h
      /usr/include/curses.h:#undef NCURSES_WCWIDTH_GRAPHICS
      /usr/include/curses.h:#define NCURSES_WCWIDTH_GRAPHICS 1
      /usr/include/ncurses.h:#undef NCURSES_WCWIDTH_GRAPHICS
      /usr/include/ncurses.h:#define NCURSES_WCWIDTH_GRAPHICS 1
      /usr/include/slang.h:#define SLWCWIDTH_SINGLE_WIDTH     0x0001 /* all double width characters given as single width */
      /usr/include/slang.h:#define SLWCWIDTH_CJK_LEGACY       0x0002 /* Ambiguous characters given width of 2 */
    

    Output of configure and result of configure.log file attached.

     
  • Jari Aalto

    Jari Aalto - 2016-06-12

    There is still trouble even if manually set:

      $ grep HAVE_DECL_WCWIDTH config.h
      #define HAVE_DECL_WCWIDTH 1
    
    ...
    gcc  -Wall -g -O2 -Wl,--no-undefined -Wl,--no-undefined -o abook.exe abook.o abook_rl.o database.o edit.o filter.o \
    getname.o getopt.o getopt1.o gettext.o ldif.o list.o mbswidth.o misc.o options.o ui.o views.o xmalloc.o  /usr/lib/libintl.dll.a -lncursesw -lreadline
    filter.o: In function `mutt_parse_file':
    /home/user/abook/abook-0.6.1/filter.c:946: undefined reference to `field_id'
    /home/user/abook/abook-0.6.1/filter.c:946:(.text+0x9c2): relocation truncated to fit: R_X86_64_PC32 against undefin\
    ed symbol `field_id'
    ...
    collect2: error: ld returned 1 exit status
    make[2]: *** [Makefile:471: abook.exe] Error 1
    

    Some -lLIBRARY is missing from the chain? Compile log attached.

     
  • Jari Aalto

    Jari Aalto - 2016-06-12

    Found similar problem from Debian, if I set manually

    config.h: HAVE_DECL_WCWIDTH 1

    And build with

    CFLAGS = -std=gnu89

    the build succeeds. Please add these fixes to the original sources.

    Ref: https://sourceforge.net/p/abook/patches/6/

     

    Last edit: Jari Aalto 2016-06-12
  • Jari Aalto

    Jari Aalto - 2016-06-12

    One more thing. Please update the GNU automake in the sources by running:

    autoreconf --install --force --verbose

     

Log in to post a comment.