程序编译成功后,运行时错误:

error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory

 

解决方法:

像libevent这种开源库,编译安装后,一般在/usr/local/lib目录下,可以通过下列命令查找:

#whereis libevent-2.0.so.5

libevent-2.0.so: /usr/local/lib/libevent-2.0.so.5

如果是自己编写的库,whereis是找不到的,当然自己也是知道该库在哪个地方的。

 

找到该库后,做一个软连接或者直接将该文件拷贝至相应lib库。

ln -s /usr/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5 

或者

cp /usr/local/lib/libevent-2.0.so.5 /usr/lib

相关文章:

  • 2021-08-19
  • 2021-08-19
  • 2021-07-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-29
  • 2021-08-30
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-11-22
  • 2022-02-20
相关资源
相似解决方案