如何安装ncursesw开发库

20
2个回答

45

这取决于您的发行版:

在Debian/Ubuntu上,使用命令sudo apt-get install libncursesw5-dev安装。

在RedHat/Fedora/CentOS上,使用命令sudo yum install ncurses-devel安装。


对我来说,dnf 报告已经安装了,但那只是 x32 版本。最终 sudo dnf install ncurses-devel.x86_64 成功解决了问题。 - jozxyqk

4

对于大多数没有root权限的用户,可以通过以下方式安装和包含ncursesw库。

    1. 下载ncurses
wget "https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.3.tar.gz"
    1. 将ncurse编译并安装到自定义路径
tar zxvf ncurses-6.3.tar.gz
cd ncurses-6.3
# customize your installation path
export LIB_PATH=$HOME/.local 
./configure  --prefix=${LIB_PATH} --enable-widec --with-shared  --with-cxx-shared
make && make install
    1. 安装基于ncurses的其他软件时,请指定ncurses库。
CFLAGS=-I${LIB_PATH}/include LDFLAGS=-L${LIB_PATH}/lib ./configure
make && make install

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接