I installed the package libncurses5-dev from the Software Center and then checked for the header file :
asheesh@ashrj-U32U:~$ ls -l /usr/include/*curses.h
-rw-r--r-- 1 root root 76291 Nov 18 2011 /usr/include/curses.h
lrwxrwxrwx 1 root root 8 Nov 18 2011 /usr/include/ncurses.h -> curses.h
-rw-r--r-- 1 root root 12180 Apr 11 2011 /usr/include/slcurses.h
Then, i checked for the library files :
asheesh@ashrj-U32U:~$ find /usr/lib/ -name "*curses*"
....
/usr/lib/x86_64-linux-gnu/libcurses.a
/usr/lib/x86_64-linux-gnu/libncurses.so
/usr/lib/x86_64-linux-gnu/libcurses.so
/usr/lib/x86_64-linux-gnu/libncurses.a
....
which are not present.
How do i install/make the library files ? Why werent they set up along with the standard package ?
On simply compiling, i get the error :
asheesh@ashrj-U32U:~$ gcc -o screen1 screen1.c -lcurses
asheesh@ashrj-U32U:~$ screen1
No command 'screen1' found, did you mean:
Command 'screen' from package 'screen' (main)
screen1: command not found
How do i use these library files ?
Here is a totally trivial program that uses (barely) the ncurses library:
Compile with:
Then run with:
I’ve found this tutorial to be a good starting point and this howto to be quite a useful reference when dealing with ncurses.