Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make can't find curses.h

I have this program called samtools (version 1.3) that is used for manipulating the files that you get from DNA sequencing experiments.

The downloaded program is contained in a folder. To set the program up I enter that folder in the terminal (on an ubuntu computer). I enter the commando "make".

it runs an prints what it does but terminates with the error message:

bam_tview_curses.o bam_tview_curses.c
bam_tview_curses.c:41:20: fatal error: curses.h: No such file or directory
 #include <curses.h>
                    ^
compilation terminated.
make: *** [bam_tview_curses.o] Error 1

My initial response (after searching the Internet) was that curses was not installed, and I tried to remedy that using sudo (apparently my user was not in the list of sudoers though.

So I tried to see if curses was already installed, after consulting the Internet I tried

ldconfig -p | grep ncurses

which gave the output:

libncursesw.so.5 (libc6,x86-64) => /lib/x86_64-linux-gnu/libncursesw.so.5
libncurses.so.5 (libc6,x86-64) => /lib/x86_64-linux-gnu/libncurses.so.5

I took this as curses was installed. But that leaves me at a loss what could have happened. But this should at least mean that curses are there right? I'm not very experianced using ubuntu or C programs (I took a smaller course in C long ago and whil I've used linux computers quite some I've mostly used the terminal for navigation)

Happy for Help!

like image 619
Gaussia Avatar asked Feb 05 '16 04:02

Gaussia


People also ask

Why do we use curse H?

h header is included from curses. h, which means that a makefile which tells the compiler to include directly from the subdirectory will fail to compile correctly. Without some special effort, it will either fail to compile at all, or the compiler may find a different unctrl. h file.

What is Ncurses library Linux?

Ncurses is a programming library providing an API, allowing the programmer to write text-based user interfaces, Text User Interface (TUI), in a terminal-independent manner. It also optimizes screen changes, in order to reduce the latency experienced when using remote Unix shell.


3 Answers

only

sudo apt-get install libncurses-dev

worked for me.

like image 155
sameer pradhan Avatar answered Nov 10 '22 07:11

sameer pradhan


ncurses is a library used for programming terminal based applications. Ubuntu users (16.04.1-Ubuntu) should install "libncurses5-dev" and "libncursesw5-dev" packages :

sudo apt-get install libncurses5-dev libncursesw5-dev
like image 23
nix Avatar answered Nov 10 '22 07:11

nix


Most Linux distributions have the header files like curses.h in a seperate package, as they are only required for compiling. Saves some space for the 95% of users that will never need them.

I don't use Ubuntu, but usually those packages are denoted with a -dev or -devel postfix. Should be easy to find via your package manager. After installing the header files the compile should proceed, you might need to install header files for other packages, so take a close look at the output.

like image 45
Erik Dannenberg Avatar answered Nov 10 '22 07:11

Erik Dannenberg