Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cmatrix - autotools build fails
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
setan
Tux's lil' helper
Tux's lil' helper


Joined: 21 Feb 2024
Posts: 87

PostPosted: Thu Jun 20, 2024 8:28 pm    Post subject: Cmatrix - autotools build fails Reply with quote

I wanted to try to build cmatrix manually to try to improve it.
However I am unable to, because if the implicit function declaration:

This is the autotools build:
Code:
$ 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:27: warning: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:27: You should run autoupdate.
./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
configure.ac:27: the top level
configure.ac:31: warning: The macro `AC_TYPE_SIGNAL' is obsolete.
configure.ac:31: You should run autoupdate.
./lib/autoconf/types.m4:776: AC_TYPE_SIGNAL is expanded from...
configure.ac:31: the top level
configure.ac:172: warning: AC_OUTPUT should be used without arguments.
configure.ac:172: 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'
user@host /tmp/cmatrix $ ./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 main in -lncurses... 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 -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... yes
checking for resizeterm in -ltinfo... yes
checking for wresize in -ltinfo... 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 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
user@host /tmp/cmatrix $ 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:850:29: warning: implicit declaration of function ‘addwstr’; did you mean ‘addstr’? [-Wimplicit-function-declaration]
  850 |                             addwstr(char_array);
      |                             ^~~~~~~
      |                             addstr
mv -f .deps/cmatrix.Tpo .deps/cmatrix.Po
gcc  -g -O2   -o cmatrix cmatrix.o  -lncurses  -ltinfo
/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:850:(.text.startup+0xa74): undefined reference to `addwstr'
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


and here is the cmatrix build, with the warning present:
Code:
$ cmake ..
CMake Deprecation Warning at CMakeLists.txt:3 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is GNU 13.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for include file config.h
-- Looking for include file config.h - found
-- Looking for include file sys/ioctl.h
-- Looking for include file sys/ioctl.h - found
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file termios.h
-- Looking for include file termios.h - found
-- Looking for include file termio.h
-- Looking for include file termio.h - found
-- Looking for include file getopt.h
-- Looking for include file getopt.h - found
-- Looking for cbreak in /usr/lib64/libncursesw.so
-- Looking for cbreak in /usr/lib64/libncursesw.so - not found
-- Looking for nodelay in /usr/lib64/libncursesw.so
-- Looking for nodelay in /usr/lib64/libncursesw.so - not found
-- Found Curses: /usr/lib64/libncursesw.so 
-- Looking for use_default_colors
-- Looking for use_default_colors - found
-- Configuring done (2.8s)
-- Generating done (0.0s)
-- Build files have been written to: /tmp/cmatrix/build
user@host /tmp/cmatrix/build $ make
[ 50%] Building C object CMakeFiles/cmatrix.dir/cmatrix.c.o
/tmp/cmatrix/cmatrix.c: In function ‘main’:
/tmp/cmatrix/cmatrix.c:850:29: warning: implicit declaration of function ‘addwstr’; did you mean ‘addstr’? [-Wimplicit-function-declaration]
  850 |                             addwstr(char_array);
      |                             ^~~~~~~
      |                             addstr
[100%] Linking C executable cmatrix
[100%] Built target cmatrix


As you can see cmake manages to build the thing but I would like to get rid of the warning to build with autotools.

I know that the header is here:
Code:
$ grep -r " addwstr(" /usr/include/
/usr/include/ncursestw/curses.h:#define addwstr(wstr)         waddwstr(stdscr,(wstr))
/usr/include/ncursesw/curses.h:#define addwstr(wstr)         waddwstr(stdscr,(wstr))


But I don't know how to link to it.
Can anyone with C experience help please?
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31073
Location: here

PostPosted: Fri Jun 21, 2024 4:26 am    Post subject: Reply with quote

Look at these upstream issues:
https://github.com/abishekvashok/cmatrix/issues/187
https://github.com/abishekvashok/cmatrix/pull/184
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum