duc icon indicating copy to clipboard operation
duc copied to clipboard

ncurses header import issue when building against MacPorts

Open pelzlpj opened this issue 8 years ago • 4 comments

Using MacPorts on macOS 10.13 to satisfy the build dependencies, I can successfully configure using LDFLAGS=-L/opt/local/lib ./configure. But when I run make, there's a header issue with ncurses:

src/duc/cmd-ui.c:30:10: fatal error: 'ncursesw/ncurses.h' file not found
#include <ncursesw/ncurses.h>
         ^~~~~~~~~~~~~~~~~~~~
1 error generated.
make[1]: *** [src/duc/cmd-ui.o] Error 1

MacPorts looks like it has a wide-char ncurses, and config.h has the following relevant entries that all look correct:

/* Define to 1 if you have the `ncurses' library (-lncurses). */
/* #undef HAVE_LIBNCURSES */

/* Define to 1 if you have the `ncursesw' library (-lncursesw). */
#define HAVE_LIBNCURSESW 1

/* Define to 1 if you have the <ncursesw/ncurses.h> header file. */
/* #undef HAVE_NCURSESW_NCURSES_H */

/* Define to 1 if you have the <ncurses.h> header file. */
#define HAVE_NCURSES_H 1

/* Define to 1 if you have the <ncurses/ncurses.h> header file. */
/* #undef HAVE_NCURSES_NCURSES_H */

pelzlpj avatar Nov 18 '17 19:11 pelzlpj

(This is resolved by using #include <ncurses.h>.)

pelzlpj avatar Nov 18 '17 19:11 pelzlpj

I guess we need to do some autoconf tweaking to fix this, still?

zevv avatar Sep 08 '18 19:09 zevv

Yes, this reproduces with current MacPorts.

pelzlpj avatar Sep 09 '18 02:09 pelzlpj

I confirm that the same issue exists with Manjaro Linux 18. This is resolved by using #include <ncurses.h> in file cmd-ui.c. It means that for some Linux distributions manual tweaking is required in order to compile. As the package is not present in the repository of all distros, some users may give up on this compilation error. The test with tputs in ./configure is maybe not sufficient to detect the appropriate #include

josephpaul0 avatar Feb 04 '19 12:02 josephpaul0