dss icon indicating copy to clipboard operation
dss copied to clipboard

Git HEAD fails to compile: `undefined reference to symbol 'stdscr'`

Open hartwork opened this issue 1 year ago • 2 comments
trafficstars

# make
cc -Wall -Wextra -O2 -DPROGNAME=\"dss\" -c -I ./include src/main.c -o src/main.o
cc -Wall -Wextra -O2 -DPROGNAME=\"dss\" -c -I ./include src/parser.c -o src/parser.o
src/parser.c: In function ‘handleMarkdownStyleLink’:
src/parser.c:139:17: warning: ignoring return value of ‘asprintf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  139 |                 asprintf(&formatString, "https://%%.%lds", parsedURLLength);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc -Wall -Wextra -O2 -DPROGNAME=\"dss\" -c -I ./include src/display.c -o src/display.o
src/display.c: In function ‘openLinkAtIndex’:
src/display.c:265:13: warning: ignoring return value of ‘asprintf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  265 |             asprintf(&systemCommand, "xdg-open %s >/dev/null 2>&1", linkGetURL(l));
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/display.c:267:13: warning: ignoring return value of ‘system’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  267 |             system(systemCommand);
      |             ^~~~~~~~~~~~~~~~~~~~~
src/display.c: In function ‘printSlideNumberInputError’:
src/display.c:192:5: warning: ‘printMessageBottomBar’ accessing 256 bytes in a region of size 80 [-Wstringop-overflow=]
  192 |     printMessageBottomBar(message);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/display.c:192:5: note: referencing argument 1 of type ‘char[256]’
src/display.c:181:6: note: in a call to function ‘printMessageBottomBar’
  181 | void printMessageBottomBar(char message[256])
      |      ^~~~~~~~~~~~~~~~~~~~~
src/display.c: In function ‘jumpToSlideAtBookmark’:
src/display.c:237:9: warning: ‘printMessageBottomBar’ accessing 256 bytes in a region of size 26 [-Wstringop-overflow=]
  237 |         printMessageBottomBar("Not a registered bookmark");
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/display.c:237:9: note: referencing argument 1 of type ‘char[256]’
src/display.c:181:6: note: in a call to function ‘printMessageBottomBar’
  181 | void printMessageBottomBar(char message[256])
      |      ^~~~~~~~~~~~~~~~~~~~~
src/display.c: In function ‘printLinksOnSlide’:
src/display.c:246:9: warning: ‘printMessageBottomBar’ accessing 256 bytes in a region of size 35 [-Wstringop-overflow=]
  246 |         printMessageBottomBar("No links detected on current slide");
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/display.c:246:9: note: referencing argument 1 of type ‘char[256]’
src/display.c:181:6: note: in a call to function ‘printMessageBottomBar’
  181 | void printMessageBottomBar(char message[256])
      |      ^~~~~~~~~~~~~~~~~~~~~
src/display.c: In function ‘openLinkAtIndex’:
src/display.c:274:5: warning: ‘printMessageBottomBar’ accessing 256 bytes in a region of size 36 [-Wstringop-overflow=]
  274 |     printMessageBottomBar("index given does not contain a link");
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/display.c:274:5: note: referencing argument 1 of type ‘char[256]’
src/display.c:181:6: note: in a call to function ‘printMessageBottomBar’
  181 | void printMessageBottomBar(char message[256])
      |      ^~~~~~~~~~~~~~~~~~~~~
src/display.c: In function ‘handleCommand’:
src/display.c:290:13: warning: ‘printMessageBottomBar’ accessing 256 bytes in a region of size 32 [-Wstringop-overflow=]
  290 |             printMessageBottomBar("Error: Not a Recognized command");
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/display.c:290:13: note: referencing argument 1 of type ‘char[256]’
src/display.c:181:6: note: in a call to function ‘printMessageBottomBar’
  181 | void printMessageBottomBar(char message[256])
      |      ^~~~~~~~~~~~~~~~~~~~~
src/display.c:303:17: warning: ‘printMessageBottomBar’ accessing 256 bytes in a region of size 22 [-Wstringop-overflow=]
  303 |                 printMessageBottomBar("Missing file argument");
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/display.c:303:17: note: referencing argument 1 of type ‘char[256]’
src/display.c:181:6: note: in a call to function ‘printMessageBottomBar’
  181 | void printMessageBottomBar(char message[256])
      |      ^~~~~~~~~~~~~~~~~~~~~
src/display.c:309:17: warning: ‘printMessageBottomBar’ accessing 256 bytes in a region of size 49 [-Wstringop-overflow=]
  309 |                 printMessageBottomBar("Missing register: type a key after bmark command");
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/display.c:309:17: note: referencing argument 1 of type ‘char[256]’
src/display.c:181:6: note: in a call to function ‘printMessageBottomBar’
  181 | void printMessageBottomBar(char message[256])
      |      ^~~~~~~~~~~~~~~~~~~~~
src/display.c:327:13: warning: ‘printMessageBottomBar’ accessing 256 bytes in a region of size 18 [-Wstringop-overflow=]
  327 |             printMessageBottomBar("Bookmarks cleared");
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/display.c:327:13: note: referencing argument 1 of type ‘char[256]’
src/display.c:181:6: note: in a call to function ‘printMessageBottomBar’
  181 | void printMessageBottomBar(char message[256])
      |      ^~~~~~~~~~~~~~~~~~~~~
src/display.c:351:17: warning: ‘printMessageBottomBar’ accessing 256 bytes in a region of size 49 [-Wstringop-overflow=]
  351 |                 printMessageBottomBar("Links not supported in double slide display mode");
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/display.c:351:17: note: referencing argument 1 of type ‘char[256]’
src/display.c:181:6: note: in a call to function ‘printMessageBottomBar’
  181 | void printMessageBottomBar(char message[256])
      |      ^~~~~~~~~~~~~~~~~~~~~
src/display.c:359:17: warning: ‘printMessageBottomBar’ accessing 256 bytes in a region of size 49 [-Wstringop-overflow=]
  359 |                 printMessageBottomBar("Links not supported in double slide display mode");
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/display.c:359:17: note: referencing argument 1 of type ‘char[256]’
src/display.c:181:6: note: in a call to function ‘printMessageBottomBar’
  181 | void printMessageBottomBar(char message[256])
      |      ^~~~~~~~~~~~~~~~~~~~~
src/display.c:365:21: warning: ‘printMessageBottomBar’ accessing 256 bytes in a region of size 32 [-Wstringop-overflow=]
  365 |                     printMessageBottomBar("No links detected on this slide");
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/display.c:365:21: note: referencing argument 1 of type ‘char[256]’
src/display.c:181:6: note: in a call to function ‘printMessageBottomBar’
  181 | void printMessageBottomBar(char message[256])
      |      ^~~~~~~~~~~~~~~~~~~~~
src/display.c: In function ‘parseUserInput’:
src/display.c:436:9: warning: ‘printMessageBottomBar’ accessing 256 bytes in a region of size 17 [-Wstringop-overflow=]
  436 |         printMessageBottomBar("Missing Argument");
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/display.c:436:9: note: referencing argument 1 of type ‘char[256]’
src/display.c:181:6: note: in a call to function ‘printMessageBottomBar’
  181 | void printMessageBottomBar(char message[256])
      |      ^~~~~~~~~~~~~~~~~~~~~
src/display.c: In function ‘searchLastInput’:
src/display.c:449:9: warning: ‘printMessageBottomBar’ accessing 256 bytes in a region of size 44 [-Wstringop-overflow=]
  449 |         printMessageBottomBar("Error: initialize a search with the '/' key");
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/display.c:449:9: note: referencing argument 1 of type ‘char[256]’
src/display.c:181:6: note: in a call to function ‘printMessageBottomBar’
  181 | void printMessageBottomBar(char message[256])
      |      ^~~~~~~~~~~~~~~~~~~~~
src/display.c:461:13: warning: ‘printMessageBottomBar’ accessing 256 bytes in a region of size 31 [-Wstringop-overflow=]
  461 |             printMessageBottomBar("You are already at last slide.");
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/display.c:461:13: note: referencing argument 1 of type ‘char[256]’
src/display.c:181:6: note: in a call to function ‘printMessageBottomBar’
  181 | void printMessageBottomBar(char message[256])
      |      ^~~~~~~~~~~~~~~~~~~~~
src/display.c:470:13: warning: ‘printMessageBottomBar’ accessing 256 bytes in a region of size 32 [-Wstringop-overflow=]
  470 |             printMessageBottomBar("You are already at first slide.");
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/display.c:470:13: note: referencing argument 1 of type ‘char[256]’
src/display.c:181:6: note: in a call to function ‘printMessageBottomBar’
  181 | void printMessageBottomBar(char message[256])
      |      ^~~~~~~~~~~~~~~~~~~~~
src/display.c:487:17: warning: ‘printMessageBottomBar’ accessing 256 bytes in a region of size 16 [-Wstringop-overflow=]
  487 |                 printMessageBottomBar("No result found");
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/display.c:487:17: note: referencing argument 1 of type ‘char[256]’
src/display.c:181:6: note: in a call to function ‘printMessageBottomBar’
  181 | void printMessageBottomBar(char message[256])
      |      ^~~~~~~~~~~~~~~~~~~~~
src/display.c: In function ‘handleKeyPress’:
src/display.c:601:17: warning: ‘printMessageBottomBar’ accessing 256 bytes in a region of size 49 [-Wstringop-overflow=]
  601 |                 printMessageBottomBar("Links not supported in double slide display mode");
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/display.c:601:17: note: referencing argument 1 of type ‘char[256]’
src/display.c:181:6: note: in a call to function ‘printMessageBottomBar’
  181 | void printMessageBottomBar(char message[256])
      |      ^~~~~~~~~~~~~~~~~~~~~
src/display.c: In function ‘addKeyToNumericalBuffer’:
src/display.c:199:17: warning: ‘%d’ directive writing between 1 and 11 bytes into a region of size 10 [-Wformat-overflow=]
  199 |     sprintf(c, "%d", key-48);
      |                 ^~
src/display.c:199:16: note: directive argument in the range [-2147483648, 2147483599]
  199 |     sprintf(c, "%d", key-48);
      |                ^~~~
In file included from /usr/include/stdio.h:980,
                 from /usr/include/curses.h:232,
                 from src/display.c:1:
In function ‘sprintf’,
    inlined from ‘addKeyToNumericalBuffer’ at src/display.c:199:5:
/usr/include/bits/stdio2.h:30:10: note: ‘__builtin___sprintf_chk’ output between 2 and 12 bytes into a destination of size 10
   30 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   31 |                                   __glibc_objsize (__s), __fmt,
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   32 |                                   __va_arg_pack ());
      |                                   ~~~~~~~~~~~~~~~~~
cc -Wall -Wextra -O2 -DPROGNAME=\"dss\" -c -I ./include src/slides.c -o src/slides.o
cc -Wall -Wextra -O2 -DPROGNAME=\"dss\" -c -I ./include src/parsecommand.c -o src/parsecommand.o
cc -Wall -Wextra -O2 -DPROGNAME=\"dss\" -c -I ./include src/mdlink.c -o src/mdlink.o
cc -Wall -Wextra -O2 src/main.o src/parser.o src/display.o src/slides.o src/parsecommand.o src/mdlink.o -o dss -lncursesw
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: src/display.o: undefined reference to symbol 'stdscr'
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../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: *** [Makefile:39: dss] Error 1

# cc -dumpversion
12

# git rev-parse HEAD
6d9e270deef0d09cce14fb2645cc134e56e2fed5

hartwork avatar Apr 14 '24 16:04 hartwork

Any thoughts?

hartwork avatar Oct 20 '24 14:10 hartwork

@codythegreat any thoughts?

hartwork avatar Nov 01 '24 19:11 hartwork

Closing to keep my https://github.com/issues clean…

hartwork avatar Nov 13 '24 15:11 hartwork