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

Last updated on June 14, 2020 by Dan Nanni

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.

Install ncursesw on Debian, Ubuntu or Linux Mint

$ sudo apt-get install libncursesw5-dev

Install ncursesw on CentOS, Fedora or RHEL

$ sudo yum install ncurses-devel

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal or credit card

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

Xmodulo © 2021 ‒ AboutWrite for UsFeed ‒ Powered by DigitalOcean