0

$ gcc -o autott autott.c -lncurses /tmp/cciOHP4W.o: In function main': autott.c:(.text+0xa): undefined reference toinitsrc' collect2: error: ld returned 1 exit status

I have installed ncurses, but it still return this error. Why?

Larry.L.Li
  • 11
  • 3
  • $ ls /usr/include/ncurses* /usr/include/ncurses_dll.h /usr/include/ncurses.h I can find ncurses.h under /usr/include – Larry.L.Li Oct 30 '16 at 12:52

1 Answers1

0

The initialization function is named initscr, not initsrc.

(You might also have forgotten to list the library when linking, e.g., -lncurses).

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105