Menu

#9 undefined reference to `setcchar'

2.0
closed
nobody
wontfix (1)
2024-07-20
2024-07-20
papoteur
No

Hello,
I'm trying to compile the project for Mageia cauldron. I take a snapshot from the last commit v3.3.
I get

Linking .o/arithmetic/arithmetic ...
Linking .o/caesar/caesar ...
Linking .o/atc/atc ...
/usr/bin/ld: .o/common/libcommon.a(ui.o): in function `mvwadd_wchw':
ui.c:(.text+0x1f4): undefined reference to `setcchar'
/usr/bin/ld: ui.c:(.text+0x210): undefined reference to `wadd_wch'
collect2: error: ld returned 1 exit status
make: *** [atc/Module.mk:23: .o/atc/atc] Error 1
make: *** Waiting for unfinished jobs....
Linking .o/battlestar/battlestar ...
/usr/bin/ld: .o/common/libcommon.a(ui.o): in function `mvwadd_wchw':
ui.c:(.text+0x1f4): undefined reference to `setcchar'
/usr/bin/ld: ui.c:(.text+0x210): undefined reference to `wadd_wch'
collect2: error: ld returned 1 exit status
make: *** [battlestar/Module.mk:23: .o/battlestar/battlestar] Error 1
Linking .o/cribbage/cribbage ...
/usr/bin/ld: .o/common/libcommon.a(ui.o): in function `mvwadd_wchw':
ui.c:(.text+0x1f4): undefined reference to `setcchar'
/usr/bin/ld: ui.c:(.text+0x210): undefined reference to `wadd_wch'
collect2: error: ld returned 1 exit status
make: *** [cribbage/Module.mk:23: .o/cribbage/cribbage] Error 1
Linking .o/dab/dab ...
/usr/bin/ld: .o/common/libcommon.a(ui.o): in function `mvwadd_wchw':
ui.c:(.text+0x1f4): undefined reference to `setcchar'
/usr/bin/ld: ui.c:(.text+0x210): undefined reference to `wadd_wch'
collect2: error: ld returned 1 exit status
make: *** [dab/Module.mk:23: .o/dab/dab] Error 1

I use gcc 14 and ncursesw from 2024-07-13

Discussion

  • Mike Sharov

    Mike Sharov - 2024-07-20

    mvwadd_wchw already uses the NCURSES_WIDECHAR to enable widechar support only if the ncurses package installed by your distribution supports it. Checking NCURSES_WIDECHAR is the official way of checking for this functionality, and there is no other, as far as I know. So I'm going to say that this is a problem with your distribution's package. These days there is no reason whatsoever to build ncurses without unicode support, so you should submit a request to your distribution packager to do so.

     
  • Mike Sharov

    Mike Sharov - 2024-07-20

    I looked at Mageia package repository, and it appears to have libncurses and libncursesw as separate libraries. The Mageia site does not let me actually download the packages, so I can't verify what's in it, but with this setup it is seems likely that libncurses package installs its pkg-config file to point only to itself, instead of aliasing to libncursesw. This makes it impossible for apps to optionally enable widechar functionality by simply looking at the headers, as bsd-games is doing. The only options are to either drop unicode support and depend on ncurses, or depend on ncursesw and not allow building without it. I do not consider either option acceptable, so this ticket is going to be resolved wontfix.

    You can still build bsd-games by modifying configure; change pkgs="ncurses" to pkgs="ncursesw".

    For an example of how to properly install the ncurses package, aliasing libncurses to libncursesw, see the Arch package source:
    https://gitlab.archlinux.org/archlinux/packaging/packages/ncurses/-/blob/main/PKGBUILD?ref_type=heads

    Feel free to forward it as a suggestion to Mageia, if you can find a way to do so.

     
  • Mike Sharov

    Mike Sharov - 2024-07-20
    • labels: --> wontfix
    • status: open --> closed
     

Log in to post a comment.