环境
centos
g++
gmp
问题描述
运行编译时的文件xx.out出现链接错误:
error while loading shared libraries: libgmpxx.so.4: cannot open shared object file: No such file or directory
解决方法
首先查找 libgmpxx.so.4
我的该库在/usr/local/lib
而本环境默认在/usr/lib
需要手动更新库
# vim /etc/ld.so.conf //在新的一行中加入库文件所在目录
/usr/local/lib //新建一行,写入
# ldconfig //更新/etc/ld.so.cache文件