cmatrix
cmatrix copied to clipboard
Fix compilation error with recent ncurses versions
LINES/COLS is no longer a variable in ncurses, but is implemented as functions returning the resp values. Therefore they can not be assigned values anymore. Fix the code to use local variables instead. Also fix problems with ncursesw (addwstr) and add logic for font location in openSUSE.
Does not work for me:
$ autoreconf -i
configure.ac:5: warning: 'AM_CONFIG_HEADER': this macro is obsolete.
configure.ac:5: You should use the 'AC_CONFIG_HEADERS' macro instead.
./lib/autoconf/general.m4:2434: AC_DIAGNOSE is expanded from...
aclocal.m4:745: AM_CONFIG_HEADER is expanded from...
configure.ac:5: the top level
configure.ac:24: warning: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:24: You should run autoupdate.
./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
configure.ac:24: the top level
configure.ac:28: warning: The macro `AC_TYPE_SIGNAL' is obsolete.
configure.ac:28: You should run autoupdate.
./lib/autoconf/types.m4:776: AC_TYPE_SIGNAL is expanded from...
configure.ac:28: the top level
configure.ac:181: warning: AC_OUTPUT should be used without arguments.
configure.ac:181: You should run autoupdate.
configure.ac:18: installing './compile'
configure.ac:8: installing './config.guess'
configure.ac:8: installing './config.sub'
configure.ac:6: installing './install-sh'
configure.ac:6: installing './missing'
Makefile.am: installing './depcomp'
$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking whether make sets $(MAKE)... (cached) yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fcntl.h... yes
checking for sys/ioctl.h... yes
checking for unistd.h... (cached) yes
checking for termios.h... yes
checking for termio.h... yes
checking for getopt.h... yes
checking return type of signal handlers... void
checking for putenv... yes
checking for curses.h... yes
checking for ncurses.h... yes
checking for tgetent in -lncursesw... no
checking for tgetent in -lncurses... no
checking for tgetent in -lcurses... no
checking for initscr in -lpdcurses... no
checking for tgetent in -ltermcap... no
usage: q <applet> <args> : invoke a portage utility applet
currently defined applets:
q <applet> <args> : virtual applet
qatom <pkg> : split atom strings
qcheck <pkgname> : verify integrity of installed packages
qdepends <pkgname> : show dependency info
qfile <filename> : list all pkgs owning files
qgrep <expr> [pkg ...]: grep in ebuilds
qkeyword <action> <args> : list packages based on keywords
qlist <pkgname> : list files owned by pkgname
qlop <pkgname> : emerge log analyzer
qmanifest <misc args> : verify or generate thick Manifest files
qmerge <pkgnames> : fetch and merge binary package
qpkg <misc args> : create or manipulate Gentoo binpkgs
qsearch <regex> : search pkgname/desc
qsize <pkgname> : calculate size usage
qtbz2 <misc args> : manipulate tbz2 packages
qtegrity <misc args> : verify files with IMA
quse <useflag> : find pkgs using useflags
qwhich <pkg ...> : find path to pkg
qxpak <misc args> : manipulate xpak archives
options: -[ioemvqChV]
-i, --install * Install symlinks for applets
-o, --overlays * Print available overlays (read from repos.conf)
-e, --envvar * Print used variables and their found values
-m, --masks * Print (package.)masks for the current profile
--root <arg> * Set the ROOT env var
-v, --verbose * Report full package versions, emit more elaborate output
-q, --quiet * Tighter output; suppress warnings
-C, --nocolor * Don't output color
--color * Force color in output
-h, --help * Print this help and exit
-V, --version * Print version and exit
checking for tgetent in -ltinfo... yes
"Using tinfo as the termcap library"
checking for use_default_colors in -ltinfo... no
checking for resizeterm in -ltinfo... no
checking for wresize in -ltinfo... no
checking for consolechars... no
checking for setfont... /usr/bin/setfont
checking for /usr/lib/kbd/consolefonts... no
checking for /usr/share/consolefonts... yes
checking for /usr/share/kbd/consolefonts... no
checking for mkfontdir... no
checking for /usr/share/fonts/misc... no
checking for /usr/share/X11/fonts/misc... no
checking for /usr/X11R6/lib/X11/fonts/misc... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating cmatrix.spec
config.status: creating config.h
config.status: executing depfiles commands
$ make -j8
make all-am
make[1]: Entering directory '/tmp/cmatrix'
gcc -DHAVE_CONFIG_H -I. -g -O2 -MT cmatrix.o -MD -MP -MF .deps/cmatrix.Tpo -c -o cmatrix.o cmatrix.c
cmatrix.c: In function ‘main’:
cmatrix.c:856:29: warning: implicit declaration of function ‘addwstr’; did you mean ‘addstr’? [-Wimplicit-function-declaration]
856 | addwstr(char_array);
| ^~~~~~~
| addstr
mv -f .deps/cmatrix.Tpo .deps/cmatrix.Po
gcc -g -O2 -o cmatrix cmatrix.o -ltinfo
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: cmatrix.o: in function `finish':
/tmp/cmatrix/cmatrix.c:113:(.text+0x13c): undefined reference to `wclear'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:114:(.text+0x148): undefined reference to `wrefresh'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:116:(.text+0x152): undefined reference to `endwin'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: cmatrix.o: in function `c_die':
/tmp/cmatrix/cmatrix.c:133:(.text+0x205): undefined reference to `wclear'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:134:(.text+0x211): undefined reference to `wrefresh'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:136:(.text+0x21b): undefined reference to `endwin'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: cmatrix.o: in function `resize_screen':
/tmp/cmatrix/cmatrix.c:315:(.text+0x6fd): undefined reference to `wclear'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:316:(.text+0x709): undefined reference to `wrefresh'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: cmatrix.o: in function `main':
/tmp/cmatrix/cmatrix.c:461:(.text.startup+0x326): undefined reference to `newterm'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:464:(.text.startup+0x337): undefined reference to `set_term'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:468:(.text.startup+0x348): undefined reference to `nonl'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:474:(.text.startup+0x352): undefined reference to `noecho'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:476:(.text.startup+0x371): undefined reference to `leaveok'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:502:(.text.startup+0x3d0): undefined reference to `has_colors'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:573:(.text.startup+0x4ad): undefined reference to `wgetch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:826:(.text.startup+0x683): undefined reference to `wattr_on'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:837:(.text.startup+0x6ba): undefined reference to `wattr_on'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:846:(.text.startup+0x712): undefined reference to `waddnstr'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:863:(.text.startup+0x747): undefined reference to `wattr_off'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:866:(.text.startup+0x759): undefined reference to `wattr_off'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:772:(.text.startup+0x77f): undefined reference to `wmove'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:776:(.text.startup+0x7b8): undefined reference to `wattr_on'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:778:(.text.startup+0x7cb): undefined reference to `wattr_on'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:784:(.text.startup+0x80e): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:794:(.text.startup+0x821): undefined reference to `wattr_off'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:799:(.text.startup+0x856): undefined reference to `wattr_off'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:466:(.text.startup+0x90d): undefined reference to `initscr'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:791:(.text.startup+0x9fa): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:780:(.text.startup+0xa2f): undefined reference to `wattr_on'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:796:(.text.startup+0xa4f): undefined reference to `wattr_off'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:856:(.text.startup+0xa74): undefined reference to `addwstr'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:860:(.text.startup+0xa91): undefined reference to `wattr_off'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:831:(.text.startup+0xab6): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:789:(.text.startup+0xac6): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:841:(.text.startup+0xadf): undefined reference to `wattr_on'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:844:(.text.startup+0xb08): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:786:(.text.startup+0xb46): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:844:(.text.startup+0xb6e): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:829:(.text.startup+0xba0): undefined reference to `wattr_on'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:831:(.text.startup+0xbb1): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:833:(.text.startup+0xbc4): undefined reference to `wattr_off'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:844:(.text.startup+0xbdd): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:879:(.text.startup+0xf27): undefined reference to `wmove'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:881:(.text.startup+0xf37): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:884:(.text.startup+0xf5b): undefined reference to `wmove'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:885:(.text.startup+0xf6c): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:886:(.text.startup+0xf7d): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:887:(.text.startup+0xf8f): undefined reference to `waddnstr'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:888:(.text.startup+0xfa0): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:889:(.text.startup+0xfb1): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:892:(.text.startup+0xfc3): undefined reference to `wmove'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:894:(.text.startup+0xfda): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:581:(.text.startup+0x115d): undefined reference to `wgetch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:503:(.text.startup+0x11c8): undefined reference to `start_color'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:519:(.text.startup+0x11d3): undefined reference to `init_pair'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:520:(.text.startup+0x11e4): undefined reference to `init_pair'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:521:(.text.startup+0x11f5): undefined reference to `init_pair'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:522:(.text.startup+0x1206): undefined reference to `init_pair'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:523:(.text.startup+0x1217): undefined reference to `init_pair'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: cmatrix.o:/tmp/cmatrix/cmatrix.c:524: more undefined references to `init_pair' follow
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:428: cmatrix] Error 1
make[1]: Leaving directory '/tmp/cmatrix'
make: *** [Makefile:329: all] Error 2
Also as you can see the ./configure
called some command badly
Can you please build against https://github.com/drmpjz/cmatrix once more? This should fix the issue during configure (there was an extra q at the end of a line, need to get a new keyboard, the escape key doesn't always work :-( )
Not sure this will fix the addwstr error for you. My fix addresses the ncurses/ncursesw case, while from the output above it looks like you don't have a ncurses at all. But maybe I am confused, you never know :-) Can you please try a man addwstr from a terminal? Does it return something at all? If so it should list the relevant include file in the synopsis. Can you post this here please?
the escape key doesn't always work :-( )
kek
here's the build log
$ autoreconf -i
configure.ac:5: warning: 'AM_CONFIG_HEADER': this macro is obsolete.
configure.ac:5: You should use the 'AC_CONFIG_HEADERS' macro instead.
./lib/autoconf/general.m4:2434: AC_DIAGNOSE is expanded from...
aclocal.m4:745: AM_CONFIG_HEADER is expanded from...
configure.ac:5: the top level
configure.ac:24: warning: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:24: You should run autoupdate.
./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
configure.ac:24: the top level
configure.ac:28: warning: The macro `AC_TYPE_SIGNAL' is obsolete.
configure.ac:28: You should run autoupdate.
./lib/autoconf/types.m4:776: AC_TYPE_SIGNAL is expanded from...
configure.ac:28: the top level
configure.ac:181: warning: AC_OUTPUT should be used without arguments.
configure.ac:181: You should run autoupdate.
configure.ac:18: installing './compile'
configure.ac:8: installing './config.guess'
configure.ac:8: installing './config.sub'
configure.ac:6: installing './install-sh'
configure.ac:6: installing './missing'
Makefile.am: installing './depcomp'
$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking whether make sets $(MAKE)... (cached) yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fcntl.h... yes
checking for sys/ioctl.h... yes
checking for unistd.h... (cached) yes
checking for termios.h... yes
checking for termio.h... yes
checking for getopt.h... yes
checking return type of signal handlers... void
checking for putenv... yes
checking for curses.h... yes
checking for ncurses.h... yes
checking for tgetent in -lncursesw... no
checking for tgetent in -lncurses... no
checking for tgetent in -lcurses... no
checking for initscr in -lpdcurses... no
checking for tgetent in -ltermcap... no
checking for tgetent in -ltinfo... yes
"Using tinfo as the termcap library"
checking for use_default_colors in -ltinfo... no
checking for resizeterm in -ltinfo... no
checking for wresize in -ltinfo... no
checking for consolechars... no
checking for setfont... /usr/bin/setfont
checking for /usr/lib/kbd/consolefonts... no
checking for /usr/share/consolefonts... yes
checking for /usr/share/kbd/consolefonts... no
checking for mkfontdir... no
checking for /usr/share/fonts/misc... no
checking for /usr/share/X11/fonts/misc... no
checking for /usr/X11R6/lib/X11/fonts/misc... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating cmatrix.spec
config.status: creating config.h
config.status: executing depfiles commands
$ make
make all-am
make[1]: Entering directory '/tmp/cmatrix'
gcc -DHAVE_CONFIG_H -I. -g -O2 -MT cmatrix.o -MD -MP -MF .deps/cmatrix.Tpo -c -o cmatrix.o cmatrix.c
cmatrix.c: In function ‘main’:
cmatrix.c:856:29: warning: implicit declaration of function ‘addwstr’; did you mean ‘addstr’? [-Wimplicit-function-declaration]
856 | addwstr(char_array);
| ^~~~~~~
| addstr
mv -f .deps/cmatrix.Tpo .deps/cmatrix.Po
gcc -g -O2 -o cmatrix cmatrix.o -ltinfo
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: cmatrix.o: in function `finish':
/tmp/cmatrix/cmatrix.c:113:(.text+0x13c): undefined reference to `wclear'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:114:(.text+0x148): undefined reference to `wrefresh'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:116:(.text+0x152): undefined reference to `endwin'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: cmatrix.o: in function `c_die':
/tmp/cmatrix/cmatrix.c:133:(.text+0x205): undefined reference to `wclear'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:134:(.text+0x211): undefined reference to `wrefresh'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:136:(.text+0x21b): undefined reference to `endwin'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: cmatrix.o: in function `resize_screen':
/tmp/cmatrix/cmatrix.c:315:(.text+0x6fd): undefined reference to `wclear'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:316:(.text+0x709): undefined reference to `wrefresh'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: cmatrix.o: in function `main':
/tmp/cmatrix/cmatrix.c:461:(.text.startup+0x326): undefined reference to `newterm'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:464:(.text.startup+0x337): undefined reference to `set_term'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:468:(.text.startup+0x348): undefined reference to `nonl'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:474:(.text.startup+0x352): undefined reference to `noecho'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:476:(.text.startup+0x371): undefined reference to `leaveok'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:502:(.text.startup+0x3d0): undefined reference to `has_colors'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:573:(.text.startup+0x4ad): undefined reference to `wgetch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:826:(.text.startup+0x683): undefined reference to `wattr_on'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:837:(.text.startup+0x6ba): undefined reference to `wattr_on'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:846:(.text.startup+0x712): undefined reference to `waddnstr'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:863:(.text.startup+0x747): undefined reference to `wattr_off'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:866:(.text.startup+0x759): undefined reference to `wattr_off'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:772:(.text.startup+0x77f): undefined reference to `wmove'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:776:(.text.startup+0x7b8): undefined reference to `wattr_on'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:778:(.text.startup+0x7cb): undefined reference to `wattr_on'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:784:(.text.startup+0x80e): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:794:(.text.startup+0x821): undefined reference to `wattr_off'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:799:(.text.startup+0x856): undefined reference to `wattr_off'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:466:(.text.startup+0x90d): undefined reference to `initscr'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:791:(.text.startup+0x9fa): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:780:(.text.startup+0xa2f): undefined reference to `wattr_on'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:796:(.text.startup+0xa4f): undefined reference to `wattr_off'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:856:(.text.startup+0xa74): undefined reference to `addwstr'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:860:(.text.startup+0xa91): undefined reference to `wattr_off'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:831:(.text.startup+0xab6): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:789:(.text.startup+0xac6): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:841:(.text.startup+0xadf): undefined reference to `wattr_on'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:844:(.text.startup+0xb08): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:786:(.text.startup+0xb46): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:844:(.text.startup+0xb6e): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:829:(.text.startup+0xba0): undefined reference to `wattr_on'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:831:(.text.startup+0xbb1): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:833:(.text.startup+0xbc4): undefined reference to `wattr_off'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:844:(.text.startup+0xbdd): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:879:(.text.startup+0xf27): undefined reference to `wmove'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:881:(.text.startup+0xf37): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:884:(.text.startup+0xf5b): undefined reference to `wmove'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:885:(.text.startup+0xf6c): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:886:(.text.startup+0xf7d): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:887:(.text.startup+0xf8f): undefined reference to `waddnstr'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:888:(.text.startup+0xfa0): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:889:(.text.startup+0xfb1): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:892:(.text.startup+0xfc3): undefined reference to `wmove'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:894:(.text.startup+0xfda): undefined reference to `waddch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:581:(.text.startup+0x115d): undefined reference to `wgetch'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:503:(.text.startup+0x11c8): undefined reference to `start_color'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:519:(.text.startup+0x11d3): undefined reference to `init_pair'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:520:(.text.startup+0x11e4): undefined reference to `init_pair'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:521:(.text.startup+0x11f5): undefined reference to `init_pair'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:522:(.text.startup+0x1206): undefined reference to `init_pair'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/cmatrix/cmatrix.c:523:(.text.startup+0x1217): undefined reference to `init_pair'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: cmatrix.o:/tmp/cmatrix/cmatrix.c:524: more undefined references to `init_pair' follow
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:428: cmatrix] Error 1
make[1]: Leaving directory '/tmp/cmatrix'
make: *** [Makefile:329: all] Error 2
I do have ncurses:
$ ldconfig -p | grep ncurses
libncursesw.so.6 (libc6,x86-64) => /lib64/libncursesw.so.6
libncursestw.so.6 (libc6,x86-64) => /lib64/libncursestw.so.6
libncursest.so.6 (libc6,x86-64) => /lib64/libncursest.so.6
libncurses.so.6 (libc6,x86-64) => /lib64/libncurses.so.6
libncurses++w.so.6 (libc6,x86-64) => /usr/lib64/libncurses++w.so.6
libncurses++w.so (libc6,x86-64) => /usr/lib64/libncurses++w.so
libncurses++tw.so.6 (libc6,x86-64) => /usr/lib64/libncurses++tw.so.6
libncurses++tw.so (libc6,x86-64) => /usr/lib64/libncurses++tw.so
libncurses++t.so.6 (libc6,x86-64) => /usr/lib64/libncurses++t.so.6
libncurses++t.so (libc6,x86-64) => /usr/lib64/libncurses++t.so
libncurses++.so.6 (libc6,x86-64) => /usr/lib64/libncurses++.so.6
libncurses++.so (libc6,x86-64) => /usr/lib64/libncurses++.so
man addwstr
shows this header:
curs_addwstr(3X) Library calls curs_addwstr(3X)
NAME
addwstr, addnwstr, waddwstr, waddnwstr, mvaddwstr, mvaddnwstr, mvwaddwstr, mvwaddnwstr - add a wide-character string to a curses win‐
dow and advance the cursor
SYNOPSIS
#include <curses.h>
int addwstr(const wchar_t *wstr);
int mvaddwstr(int y, int x, const wchar_t *wstr);
int mvwaddwstr(WINDOW *win, int y, int x, const wchar_t *wstr);
int waddwstr(WINDOW *win, const wchar_t *wstr);
int addnwstr(const wchar_t *wstr, int n);
int mvaddnwstr(int y, int x, const wchar_t *wstr, int n);
int mvwaddnwstr(WINDOW *win, int y, int x, const wchar_t *wstr, int n);
int waddnwstr(WINDOW *win, const wchar_t *wstr, int n);
and addwstr
is here:
$ grep --recursive "addwstr" /usr/include/
/usr/include/ncursestw/curses.h:extern NCURSES_EXPORT(int) addwstr (const wchar_t *); /* generated:WIDEC */
/usr/include/ncursestw/curses.h:extern NCURSES_EXPORT(int) mvaddwstr (int, int, const wchar_t *); /* generated:WIDEC */
/usr/include/ncursestw/curses.h:extern NCURSES_EXPORT(int) mvwaddwstr (WINDOW *, int, int, const wchar_t *); /* generated:WIDEC */
/usr/include/ncursestw/curses.h:extern NCURSES_EXPORT(int) waddwstr (WINDOW *,const wchar_t *); /* generated:WIDEC */
/usr/include/ncursestw/curses.h:#define addwstr(wstr) waddwstr(stdscr,(wstr))
/usr/include/ncursestw/curses.h:#define waddwstr(win,wstr) waddnwstr((win),(wstr),-1)
/usr/include/ncursestw/curses.h:#define mvaddwstr(y,x,wstr) mvwaddwstr(stdscr,(y),(x),(wstr))
/usr/include/ncursestw/curses.h:#define mvwaddwstr(win,y,x,wstr) (wmove(win,(y),(x)) == ERR ? ERR : waddwstr((win),(wstr)))
/usr/include/ncursesw/curses.h:extern NCURSES_EXPORT(int) addwstr (const wchar_t *); /* generated:WIDEC */
/usr/include/ncursesw/curses.h:extern NCURSES_EXPORT(int) mvaddwstr (int, int, const wchar_t *); /* generated:WIDEC */
/usr/include/ncursesw/curses.h:extern NCURSES_EXPORT(int) mvwaddwstr (WINDOW *, int, int, const wchar_t *); /* generated:WIDEC */
/usr/include/ncursesw/curses.h:extern NCURSES_EXPORT(int) waddwstr (WINDOW *,const wchar_t *); /* generated:WIDEC */
/usr/include/ncursesw/curses.h:#define addwstr(wstr) waddwstr(stdscr,(wstr))
/usr/include/ncursesw/curses.h:#define waddwstr(win,wstr) waddnwstr((win),(wstr),-1)
/usr/include/ncursesw/curses.h:#define mvaddwstr(y,x,wstr) mvwaddwstr(stdscr,(y),(x),(wstr))
/usr/include/ncursesw/curses.h:#define mvwaddwstr(win,y,x,wstr) (wmove(win,(y),(x)) == ERR ? ERR : waddwstr((win),(wstr)))
There is progress I think:
$ autoreconf -i
configure.ac:24: warning: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:24: You should run autoupdate.
./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
configure.ac:24: the top level
configure.ac:28: warning: your code may safely assume C89 semantics that RETSIGTYPE is void.
configure.ac:28: Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.
./lib/autoconf/general.m4:2434: AC_DIAGNOSE is expanded from...
configure.ac:28: the top level
configure.ac:18: installing './compile'
configure.ac:8: installing './config.guess'
configure.ac:8: installing './config.sub'
configure.ac:6: installing './install-sh'
configure.ac:6: installing './missing'
Makefile.am: installing './depcomp'
$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking whether make sets $(MAKE)... (cached) yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fcntl.h... yes
checking for sys/ioctl.h... yes
checking for unistd.h... (cached) yes
checking for termios.h... yes
checking for termio.h... yes
checking for getopt.h... yes
checking return type of signal handlers... void
checking for putenv... yes
checking for curses.h... yes
checking for ncurses.h... yes
checking for tgetent in -lncursesw... no
checking for tgetent in -lncurses... no
checking for tgetent in -lcurses... no
checking for initscr in -lpdcurses... no
checking for tgetent in -ltermcap... no
checking for tgetent in -ltinfo... yes
Using tinfo as the termcap library
checking for addwstr in -lncursesw... yes
Using ncursesw as the ncurses library
checking for addwstr in -lncursesw... (cached) yes
checking for use_default_colors in -lncursesw... yes
checking for resizeterm in -lncursesw... yes
checking for wresize in -lncursesw... yes
checking for consolechars... no
checking for setfont... /usr/bin/setfont
checking for /usr/lib/kbd/consolefonts... no
checking for /usr/share/consolefonts... yes
checking for /usr/share/kbd/consolefonts... no
checking for mkfontdir... no
checking for /usr/share/fonts/misc... no
checking for /usr/share/X11/fonts/misc... no
checking for /usr/X11R6/lib/X11/fonts/misc... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating cmatrix.spec
config.status: creating config.h
config.status: executing depfiles commands
$ make
make all-am
make[1]: Entering directory '/tmp/cmatrix'
gcc -DHAVE_CONFIG_H -I. -g -O2 -MT cmatrix.o -MD -MP -MF .deps/cmatrix.Tpo -c -o cmatrix.o cmatrix.c
mv -f .deps/cmatrix.Tpo .deps/cmatrix.Po
gcc -g -O2 -o cmatrix cmatrix.o -lncursesw
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: cmatrix.o: undefined reference to symbol 'stdscr'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /lib64/libtinfow.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:428: cmatrix] Error 1
make[1]: Leaving directory '/tmp/cmatrix'
make: *** [Makefile:329: all] Error 2
In the future, will just make listings suffice?
The autoreconf issues are something you need to check on your end (you seem to be on a newer version of auto tools). Once we found a working link, please run autoupdate on your end to get rid of the warning (and I will check on my end if it still works with the older version of autotools. I'll check the missing symbols later. Still have a long run on my todo list for today :-)
I am not sure what you mean by autoreconf issues and a working link. It's my first time working with autotools. Ii'm on version 2.71.
I run autoupdate and here's what it changed:
$ diff configure.ac configure.ac.bak
24,32c24
< m4_warn([obsolete],
< [The preprocessor macro `STDC_HEADERS' is obsolete.
< Except in unusual embedded environments, you can safely include all
< ISO C90 headers unconditionally.])dnl
< # Autoupdate added the next two lines to ensure that your configure
< # script's behavior did not change. They are probably safe to remove.
< AC_CHECK_INCLUDES_DEFAULT
< AC_PROG_EGREP
<
---
> AC_HEADER_STDC
36c28
< m4_warn([obsolete],[your code may safely assume C89 semantics that RETSIGTYPE is void.
---
> AC_DIAGNOSE([obsolete],[your code may safely assume C89 semantics that RETSIGTYPE is void.
I'll check the missing symbols later.
No problem and thank you!
Can you please try once more? And if you don't mind telling, what distro (and version) are you building on?
I am running Gentoo 2.15 on amd64 with the profile default/linux/amd64/23.0/split-usr/desktop
Ncurses is
sys-libs/ncurses-6.4_p20240414:0/6::gentoo USE="cxx gpm profile (split-usr) stack-realign (tinfo) verify-sig -ada -debug -doc -minimal -static-libs -test -trace" ABI_X86="(64) -32 (-x32)"
Here's the build log:
autoreconf -i
configure.ac:28: warning: your code may safely assume C89 semantics that RETSIGTYPE is void.
configure.ac:28: Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.
configure.ac:18: installing './compile'
configure.ac:8: installing './config.guess'
configure.ac:8: installing './config.sub'
configure.ac:6: installing './install-sh'
configure.ac:6: installing './missing'
Makefile.am: installing './depcomp'
$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking whether make sets $(MAKE)... (cached) yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for fcntl.h... yes
checking for sys/ioctl.h... yes
checking for unistd.h... (cached) yes
checking for termios.h... yes
checking for termio.h... yes
checking for getopt.h... yes
checking return type of signal handlers... void
checking for putenv... yes
checking for curses.h... yes
checking for ncurses.h... yes
checking for tgetent in -lncursesw... no
checking for tgetent in -lncurses... no
checking for tgetent in -lcurses... no
checking for initscr in -lpdcurses... no
checking for tgetent in -ltermcap... no
checking for tgetent in -ltinfo... yes
Using tinfo as the termcap library
checking for addwstr in -lncursesw... yes
Using ncursesw as the ncurses library
checking for addwstr in -lncursesw... (cached) yes
checking for use_default_colors in -lncursesw... yes
checking for resizeterm in -lncursesw... yes
checking for wresize in -lncursesw... yes
checking for consolechars... no
checking for setfont... /usr/bin/setfont
checking for /usr/lib/kbd/consolefonts... no
checking for /usr/share/consolefonts... yes
checking for /usr/share/kbd/consolefonts... no
checking for mkfontdir... no
checking for /usr/share/fonts/misc... no
checking for /usr/share/X11/fonts/misc... no
checking for /usr/X11R6/lib/X11/fonts/misc... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating cmatrix.spec
config.status: creating config.h
config.status: executing depfiles commands
$ make
make all-am
make[1]: Entering directory '/tmp/cmatrix'
gcc -DHAVE_CONFIG_H -I. -g -O2 -MT cmatrix.o -MD -MP -MF .deps/cmatrix.Tpo -c -o cmatrix.o cmatrix.c
mv -f .deps/cmatrix.Tpo .deps/cmatrix.Po
gcc -g -O2 -o cmatrix cmatrix.o -lncursesw -ltinfo
make[1]: Leaving directory '/tmp/cmatrix'
$ ./cmatrix
Segmentation fault