I am not a C guru. I am trying to compile someone else's C code, and am getting the following error:
Undefined symbols for architecture x86_64:
"_stdscr", referenced from:
_new_line in libsms.a(cstatus.o)
_message in libsms.a(cstatus.o)
the "stdscr" method comes from, I think, both "ncurses.h" and "curses.h". The code seems to be expecting "ncurses.h".
The "ncurses.h" file appears to define "stdscr" (no underscore in the name) whereas the linker is complaining about the symbol "_stdscr" (note the underscore).
I have -lncurses in my compiler flags, and I think that bit is working.
If I change the C source code to refer to the variable as "_stdscr", I get
error: ‘_stdscr’ undeclared
instead.
Can someone please
- explain where this underscore is coming from and what it's doing?
- help me how to know for sure that the ncurses.h header is being correctly found and referenced?
- point me in the right direction for further investigation?