问题描述
开发环境:CentOS 6.5 X86-64 编译代码提示 cannot find -ltermcap,应该是缺少 libtermcap.a 文件。
[root@localhost ~]# cat /etc/redhat-release
CentOS release 6.5 (Final)
[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
编译错误提示:
/usr/bin/ld: cannot find -ltermcap
collect2: ld returned 1 exit status
解决办法
1 下载源代码
可以直接使用命令下载:
wget http://ftp.gnu.org/gnu/termcap/termcap-1.3.1.tar.gz
也可以自己上网查询其他下载路径:
termcap-1.3.1
解压
tar -zvxf termcap-1.3.1.tar.gz
安装
这里建议root执行
cd termcap-1.3.1
./configure
make
make install #这一步需要root权限