gabrielzschmitz / Tomato.C

A pomodoro timer written in pure C.
GNU General Public License v3.0
315 stars 19 forks source link

Tomato cannot be built due to undefined references #10

Closed luisnquin closed 1 year ago

luisnquin commented 1 year ago

The latest commit that worked for me in my Nix machine is the 11a152fc6c4bdd49b0c212ddf8c1721441270152

Here you can see the full logs:

building '/nix/store/6qjvcwipq9j25l6zs1j0ywwjdpgbmd0s-tomato.drv'...
unpacking sources
unpacking source archive /nix/store/k29sjbfiakidzb5lvvbkjm02hqjz2fsv-Tomato.C
source root is Tomato.C
patching sources
configuring
no configure script, doing nothing
building
build flags: SHELL=/nix/store/4xw8n979xpivdc46a9ndcvyhwgif00hz-bash-5.1-p16/bin/bash
gcc -Wall -Wextra -pedantic -Os -I/usr/local/include  -c -o tomato.o tomato.c
gcc -Wall -Wextra -pedantic -Os -I/usr/local/include  -c -o util.o util.c
gcc -Wall -Wextra -pedantic -Os -I/usr/local/include  -c -o input.o input.c
input.c: In function 'mainMenuInput':
input.c:221:21: warning: ignoring return value of 'system' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
  221 |                     system("notify-send -t 5000 -c Tomato.C \'華 Work!\' \'You need to focus\'");
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.c:223:21: warning: ignoring return value of 'system' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
  223 |                     system("notify-send -t 5000 -c Tomato.C \'👷 Work!\' \'You need to focus\'");
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.c:225:21: warning: ignoring return value of 'system' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
  225 |                     system("notify-send -t 5000 -c Tomato.C \'Work! You need to focus\'");
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.c:229:17: warning: ignoring return value of 'system' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
  229 |                 system("mpv --no-vid --no-input-terminal --volume=50 /usr/local/share/tomato/sounds/dfltnotify.mp3 --really-quiet &");
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.c:261:21: warning: ignoring return value of 'system' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
  261 |                     system("notify-send -t 5000 -c Tomato.C \'華 Work!\' \'You need to focus\'");
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.c:263:21: warning: ignoring return value of 'system' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
  263 |                     system("notify-send -t 5000 -c Tomato.C \'👷 Work!\' \'You need to focus\'");
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.c:265:21: warning: ignoring return value of 'system' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
  265 |                     system("notify-send -t 5000 -c Tomato.C \'Work! You need to focus\'");
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.c:269:17: warning: ignoring return value of 'system' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
  269 |                 system("mpv --no-vid --no-input-terminal --volume=50 /usr/local/share/tomato/sounds/dfltnotify.mp3 --really-quiet &");
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -Wall -Wextra -pedantic -Os -I/usr/local/include  -c -o update.o update.c
update.c: In function 'doUpdate':
update.c:66:25: warning: ignoring return value of 'system' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
   66 |                         system("notify-send -t 5000 -c Tomato.C \' Pause Break\' \'You have some time chill\'");
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
update.c:68:25: warning: ignoring return value of 'system' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
   68 |                         system("notify-send -t 5000 -c Tomato.C \'🌴 Pause Break\' \'You have some time chill\'");
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
update.c:70:25: warning: ignoring return value of 'system' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
   70 |                         system("notify-send -t 5000 -c Tomato.C \'Long Pause Break. You have some time chill\'");
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
update.c:74:21: warning: ignoring return value of 'system' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
   74 |                     system("mpv --no-vid --no-input-terminal --volume=50 /usr/local/share/tomato/sounds/pausenotify.mp3 --really-quiet &");
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
update.c:91:25: warning: ignoring return value of 'system' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
   91 |                         system("notify-send -t 5000 -c Tomato.C \' Pause Break\' \'You have some time chill\'");
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
update.c:93:25: warning: ignoring return value of 'system' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
   93 |                         system("notify-send -t 5000 -c Tomato.C \'☕ Pause Break\' \'You have some time chill\'");
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
update.c:95:25: warning: ignoring return value of 'system' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
   95 |                         system("notify-send -t 5000 -c Tomato.C \'Pause Break. You have some time chill\'");
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
update.c:99:21: warning: ignoring return value of 'system' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
   99 |                     system("mpv --no-vid --no-input-terminal --volume=50 /usr/local/share/tomato/sounds/pausenotify.mp3 --really-quiet &");
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
update.c:132:21: warning: ignoring return value of 'system' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
  132 |                     system("notify-send -t 5000 -c Tomato.C \'華 Work!\' \'You need to focus\'");
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
update.c:134:21: warning: ignoring return value of 'system' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
  134 |                     system("notify-send -t 5000 -c Tomato.C \'👷 Work!\' \'You need to focus\'");
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
update.c:136:21: warning: ignoring return value of 'system' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
  136 |                     system("notify-send -t 5000 -c Tomato.C \'Work! You need to focus\'");
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
update.c:140:17: warning: ignoring return value of 'system' declared with attribute 'warn_unused_result' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wunused-result-Wunused-result8;;]
  140 |                 system("mpv --no-vid --no-input-terminal --volume=50 /usr/local/share/tomato/sounds/dfltnotify.mp3 --really-quiet &");
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -Wall -Wextra -pedantic -Os -I/usr/local/include  -c -o anim.o anim.c
gcc -L/usr/local/lib  tomato.o util.o input.o update.o anim.o  `pkg-config --libs ncursesw` -o tomato
/nix/store/4xw8n979xpivdc46a9ndcvyhwgif00hz-bash-5.1-p16/bin/bash: line 1: pkg-config: command not found
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: tomato.o: in function `drawScreen':
tomato.c:(.text+0x55): undefined reference to `stdscr'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: tomato.c:(.text+0x5d): undefined reference to `werase'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: tomato.c:(.text+0x12c): undefined reference to `wrefresh'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: tomato.o: in function `main':
tomato.c:(.text.startup+0x7d): undefined reference to `napms'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.o: in function `initScreen':
util.c:(.text+0x4): undefined reference to `initscr'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.c:(.text+0x9): undefined reference to `use_default_colors'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.c:(.text+0xe): undefined reference to `has_colors'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.c:(.text+0x17): undefined reference to `start_color'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.c:(.text+0x2d): undefined reference to `init_pair'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.c:(.text+0x3f): undefined reference to `noecho'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.c:(.text+0x4b): undefined reference to `mousemask'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.c:(.text+0x5e): undefined reference to `mouseinterval'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.c:(.text+0x63): undefined reference to `cbreak'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.c:(.text+0x6a): undefined reference to `curs_set'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.c:(.text+0x71): undefined reference to `stdscr'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.c:(.text+0x7e): undefined reference to `nodelay'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.o: in function `setColor':
util.c:(.text+0x9b): undefined reference to `stdscr'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.o: in function `getWindowSize':
util.c:(.text+0xb6): undefined reference to `stdscr'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.o: in function `printMainMenu':
util.c:(.text+0x2b1): undefined reference to `mvprintw'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.c:(.text+0x31b): undefined reference to `mvprintw'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.o: in function `printSettings':
util.c:(.text+0x3c2): undefined reference to `mvprintw'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.c:(.text+0x428): undefined reference to `mvprintw'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.c:(.text+0x4a0): undefined reference to `mvprintw'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.o:util.c:(.text+0x516): more undefined references to `mvprintw' follow
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.o: in function `initScreen':
util.c:(.text+0x8e): undefined reference to `keypad'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.o: in function `setColor':
util.c:(.text+0xaf): undefined reference to `wattrset'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.o: in function `printPomodoroCounter':
util.c:(.text+0x16e): undefined reference to `mvprintw'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.o: in function `printPauseIndicator':
util.c:(.text+0x23a): undefined reference to `mvprintw'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.o: in function `printMainMenu':
util.c:(.text+0x386): undefined reference to `mvprintw'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: util.o: in function `printSettings':
util.c:(.text+0x5fb): undefined reference to `mvprintw'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: input.o: in function `mainMenuInput':
input.c:(.text+0x5d): undefined reference to `endwin'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: input.o: in function `handleInputs':
input.c:(.text+0x4ec): undefined reference to `stdscr'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: input.c:(.text+0x509): undefined reference to `wgetch'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: input.c:(.text+0x5cb): undefined reference to `endwin'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: input.c:(.text+0x5e2): undefined reference to `wclear'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: input.c:(.text+0x5ea): undefined reference to `wrefresh'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: input.c:(.text+0x60c): undefined reference to `getmouse'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: input.c:(.text+0x73e): undefined reference to `endwin'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: input.c:(.text+0x74a): undefined reference to `flushinp'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: anim.o: in function `printLogo':
anim.c:(.text+0xce): undefined reference to `mvprintw'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: anim.c:(.text+0xee): undefined reference to `mvprintw'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: anim.c:(.text+0x16f): undefined reference to `mvprintw'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: anim.c:(.text+0x18f): undefined reference to `mvprintw'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: anim.c:(.text+0x1e8): undefined reference to `mvprintw'
/nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: anim.o:anim.c:(.text+0x208): more undefined references to `mvprintw' follow
collect2: error: ld returned 1 exit status
make: *** [<builtin>: tomato] Error 1
error: builder for '/nix/store/6qjvcwipq9j25l6zs1j0ywwjdpgbmd0s-tomato.drv' failed with exit code 2;
       last 10 log lines:
       > /nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: input.c:(.text+0x74a): undefined reference to `flushinp'
       > /nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: anim.o: in function `printLogo':
       > anim.c:(.text+0xce): undefined reference to `mvprintw'
       > /nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: anim.c:(.text+0xee): undefined reference to `mvprintw'
       > /nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: anim.c:(.text+0x16f): undefined reference to `mvprintw'
       > /nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: anim.c:(.text+0x18f): undefined reference to `mvprintw'
       > /nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: anim.c:(.text+0x1e8): undefined reference to `mvprintw'
       > /nix/store/frh9l9nrdysasdi2gs7i241s241ngjw2-binutils-2.39/bin/ld: anim.o:anim.c:(.text+0x208): more undefined references to `mvprintw' follow
       > collect2: error: ld returned 1 exit status
       > make: *** [<builtin>: tomato] Error 1
       For full logs, run 'nix log /nix/store/6qjvcwipq9j25l6zs1j0ywwjdpgbmd0s-tomato.drv'.
gabrielzschmitz commented 1 year ago

Try to change makefile pkg config from ncursesw to just ncurses

luisnquin commented 1 year ago

I was thinking that pkgconfig was a dependency that was already satisfied but apparently not 😮‍💨

I will open a PR to resolve this

luisnquin commented 1 year ago

PR here https://github.com/gabrielzschmitz/Tomato.C/pull/11