How to fix “fatal error: ncursesw/ncurses.h: No such file or directory”

Question: When I try to compile a program, it fails with the following error.

fatal error: ncursesw/ncurses.h: No such file or directory
#include <ncursesw/ncurses.h>

How can I fix this error on [insert your Linux distro]?

ncursesw/ncurses.h is a development header file for ncursesw, which is source-compatible with ncurses library, but supports wide characters or Unicode (UTF8). The compile error implies that the development header files and libraries for ncursesw are not installed on your Linux system.

To fix this error, you need to install the development library for ncursesw as follows.

On Debian, Ubuntu or Linux Mint:

$ sudo apt-get install libncursesw5-dev

On CentOS, Fedora or RHEL:

$ sudo yum install ncurses-devel
Download this article as ad-free PDF (made possible by your kind donation): 
Download PDF

Subscribe to Ask Xmodulo

Do you want to receive Linux related questions & answers published at Ask Xmodulo? Enter your email address below, and we will deliver our Linux Q&A straight to your email box, for free. Delivery powered by Google Feedburner.


Support Xmodulo

Did you find this tutorial helpful? Then please be generous and support Xmodulo!

Leave a comment

Your email address will not be published. Required fields are marked *