I'm having a hard time implementing the ncurses library in FreeBSD 10
This is what I do:
1. install lib:
2. src file:
3. compile:
4. output:
*At some point I tried using both, the
and
with the same result.
What am I missing?
This is what I do:
1. install lib:
pkg install ncurses-5.9.20150214
2. src file:
Code:
#include <ncurses.h>
int main(void) {
initsrc();
addstr("Hello World!");
refresh();
getch();
endwin();
return 0;
}
3. compile:
cc -o ncurses.o ncurses.c
(do I need to link any lib. here?)4. output:
Code:
ncurses.c:7:3: warning: implicit declaration of function 'initsrc' is invalid in
C99 [-Wimplicit-function-declaration]
initsrc();
^
1 warning generated.
/tmp/ncurses-xTwg1E.o: In function `main':
ncurses.c:(.text+0x19): undefined reference to `initsrc'
ncurses.c:(.text+0x26): undefined reference to `curs_set'
ncurses.c:(.text+0x3b): undefined reference to `stdscr'
ncurses.c:(.text+0x43): undefined reference to `waddnstr'
ncurses.c:(.text+0x4b): undefined reference to `stdscr'
ncurses.c:(.text+0x53): undefined reference to `wrefresh'
ncurses.c:(.text+0x5b): undefined reference to `stdscr'
ncurses.c:(.text+0x63): undefined reference to `wgetch'
ncurses.c:(.text+0x6b): undefined reference to `endwin'
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*At some point I tried using both, the
Code:
#include <ncurses.h>
Code:
#include <curses.h>
What am I missing?