How to resolve : fatal error: curses.h: No such file or directory

Whenever you are trying to do kernel menuconfig very first time after installation of Ubuntu, its chances that you will see the error as below,

 $ make ARCH=arm CROSS_COMPILE=arm-bcm2708-linux-gnueabi- menuconfig
  HOSTCC  scripts/kconfig/mconf.o
In file included from scripts/kconfig/mconf.c:23:0:
scripts/kconfig/lxdialog/dialog.h:38:20: fatal error: curses.h: No such file or directory
compilation terminated.
scripts/Makefile.host:124: recipe for target 'scripts/kconfig/mconf.o' failed
make[1]: *** [scripts/kconfig/mconf.o] Error 1
Makefile:546: recipe for target 'menuconfig' failed
make: *** [menuconfig] Error 2

This error is due to that your ubuntu doesn’t have “ncurses” library installed. Ncurses is required for having menu like user interface onto the terminal.
You can read more about ncurses at https://en.wikipedia.org/wiki/Ncurses

Lets identify which is the related ncurses package is available for installation,

$ sudo apt-cache search libncurses
libncurses5 - shared libraries for terminal handling
libncurses5-dbg - debugging/profiling libraries for ncurses
libncurses5-dev - developer's libraries for ncurses

Now, lets install this library as,

$ sudo apt-get install libncurses5 libncurses5-dev

You may see some different version of libncurses and use the same as you see in apt-cache search command.

Hive OS Linux commands for beginners x
Hive OS Linux commands for beginners

Leave a Comment

Sign up to our newsletter!

ADB Commands Android Android Applications Android Build system Application Libraries Application Stack / User Interface Bash / Shell Scripts Bluetooth driver Cloud Technologies Commands and Packages Compilation Content Management System Core Kernel C Programs Development, Debugging and Performance Tools Development and Build Development Environment Setup Django & REST Api Errors & Failures Git Hardware Platforms HTML JAVA Programs Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Multimedia NDK / Middleware / HAL Operating System Concepts PHP Programming Languages Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Source Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Web Design and Development Website Hosting Wordpress Yocto Embedded Linux