PDA

View Full Version : help with the curses libary


DFord425
December 18th, 2007, 11:33 AM
I am trying to compile a C program using the curses library but i get an error saying dford@dford-laptop:~/CS355$ cc snake.c -lcurses -o snake
snake.c:9:20: error: curses.h: No such file or directory
snake.c: In function ‘main’:
snake.c:28: error: ‘LINES’ undeclared (first use in this function)
snake.c:28: error: (Each undeclared identifier is reported only once
snake.c:28: error: for each function it appears in.)
snake.c:22: warning: return type of ‘main’ is not ‘int’

Do i need to install it with build essential? I thought i did that when i installed the other libraries for C.

adityakavoor
December 18th, 2007, 12:52 PM
open synaptic
search ncurses
install libncurses5
libncurses5-dbg
libncurses5-dev

DFord425
December 18th, 2007, 01:06 PM
i installed libcurses5, but i could not find libcurses5-dbg, and libcurses5-dev

adityakavoor
December 18th, 2007, 01:11 PM
sudo apt-get install libncurses5-dev libncurses5-dbg

DFord425
December 18th, 2007, 01:15 PM
I get this[CODE]dford@dford-laptop:~$ sudo apt-get install libncurses5-dev libncurses5-dbg
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libncurses5-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package libncurses5-dev has no installation candidate
[CODE]

adityakavoor
December 18th, 2007, 11:54 PM
check whether the Universe component is checked in
System > Admin > Software Sources

run
sudo apt-get update


then try

DFord425
December 21st, 2007, 01:36 AM
still not working E: Package libncurses5-dev has no installation candidate