BLOG
Enjoy when you can, and endure when you must.
cannot find -lncurses

今天尝试安装python的readline包时发生如下错误:

/usr/bin/ld: cannot find -lncurses

这是在Linux环境编译应用程序或lib的source code时因缺少库文件(命名方法:lib + 库名 + .so)而常出现的错误,其可能的原因如下:


1. lib(.so档)的symbolic link 不正确,没有连结到正确的函式库文件(.so),针对这种情况,只要改成正确的链接目标即可解决问题;

2. 系统没有安装相对应的lib或相对应的lib版本不对,这种情况则需要重新安装lib。


而这里我遇到的情况就是未安装对应的lib,因此正确安装后问题即可解决:

yum install ncurses ncurses-devel
COMMENTS
LEAVE COMMNT