error while loading shared libraries: librdkafka++.so.1: cannot open shared object file: No such file or directory 解决办法

1,cd /etc/

2,sudo ldconfig

///

/*********************** over****************************/

//

出错如下:

主要错误:error while loading shared libraries: libboost_regex.so.1.51.0: cannot open shared object file: No such file or directory

错误过程如下:

[cpp] view plain copy

  1. [root@node07 C++]# ll
  2. 总用量 960
  3. -rw-r--r--. 1 root root  90915  9月 15 20:47 1.html
  4. -rw-r--r--. 1 root root  86714  9月 15 20:48 2.html
  5. -rw-r--r--. 1 root root  89032  9月 15 20:49 3.html
  6. -rw-r--r--. 1 root root    239  9月 16 10:40 main.cpp
  7. -rw-r--r--. 1 root root   5684  9月 16 10:48 main.o
  8. -rw-r--r--. 1 root root    320  9月 16 10:28 Makefile
  9. -rwxr-xr-x. 1 root root 256884  9月 16 10:48 target
  10. -rw-r--r--. 1 root root      0  9月 15 20:49 test.txt
  11. -rw-r--r--. 1 root root   4365  9月 15 20:35 TextExtractor.cpp
  12. -rw-r--r--. 1 root root   1710  9月 15 20:58 TextExtractor.h
  13. -rw-r--r--. 1 root root 421412  9月 16 10:48 TextExtractor.o
  14. [root@node07 C++]# ./target
  15. ./target: error while loading shared libraries: libboost_regex.so.1.51.0: cannot open shared object
  16. file: No such file or directory

那就表示系统不知道xxx.so放在哪个目录下,这个时候就要在/etc/ld.so.conf中加入xxx.so所在的目录。首先查找存在的目录,结果为/usr/local/boost_1_51_0/~/boost_install/lib/,具体操作如下:

[cpp] view plain copy

  1. [root@node07 C++]# find / -name libboost_regex.*
  2. /usr/local/boost_1_51_0/bin.v2/libs/regex/build/gcc-4.4.5/release/threading-multi/libboost_regex.so.1.51.0
  3. /usr/local/boost_1_51_0/bin.v2/libs/regex/build/gcc-4.4.5/release/link-static/threading-multi/libboost_regex.a
  4. /usr/local/boost_1_51_0/~/boost_install/lib/libboost_regex.so.1.51.0
  5. /usr/local/boost_1_51_0/~/boost_install/lib/libboost_regex.so
  6. /usr/local/boost_1_51_0/~/boost_install/lib/libboost_regex.a

一般而言,有很多so档会在/usr/local/lib这个目录下,所以在/etc/ld.so.conf中加入/usr/local/lib这一行,可以解决此问题。

将/etc/ld.so.conf存档后,还要执行/etc/ldconfig 来更新一下才会生效。

[cpp] view plain copy

  1. [root@node07 C++]# cd /etc/
  2. [root@node07 etc]# ldconfig

再次运行target 无错误。

获取更多帮主请关注小程序

error while loading shared libraries解决办法相关推荐

  1. error while loading shared libraries 解决办法

    当运行程序时会出现如下类似错误时: error while loading shared libraries: libXXXXXXX.so.1: cannot open shared object f ...

  2. 【转】error while loading shared libraries: xxx.so.x 错误的原因和解决办法

    原博客地址:http://www.cnblogs.com/Anker/p/3209876.html#undefined error while loading shared libraries: xx ...

  3. 解决error while loading shared libraries: xxx.so.x类似问题办法和错误原因

      解决error while loading shared libraries: xxx.so.x"类似问题办法和错误原因 编译Tengine时,执行make命令,出现以下错误: erro ...

  4. Linux中error while loading shared libraries错误解决办法

    默认情况下,编译器只会使用/lib和/usr/lib这两个目录下的库文件,通常通过源码包进行安装时,如果不指定--prefix,会将库安装在/usr/local/lib目录下:当运行程序需要链接动态库 ...

  5. Oracle RAC安装过程中遇到“error while loading shared libraries libpthread.so.0”的解决办法...

    在CentOS 5上安装Oracle 10.2.0.1 RAC的cluster software的时候,在最后一步,第二个节点,执行root.sh的时候,报告error while loading s ...

  6. 【linux排错】error while loading shared libraries: xxx.so.x 错误的原因和解决办法

    一般我们在Linux下执行某些外部程序的时候可能会提示找不到共享库的错误, 比如: lcw: error while loading shared libraries: libjson.so.0: c ...

  7. error while loading shared libraries: xxx.so.x错误的原因和解决办法

    一般我们在Linux下执行某些外部程序的时候可能会提示找不到共享库的错误, 比如: tmux: error while loading shared libraries: libevent-1.4.s ...

  8. error while loading shared libraries: xxx.so.x 错误的原因和解决办法

    一般我们在Linux下执行某些外部程序的时候可能会提示找不到共享库的错误, 比如: tmux: error while loading shared libraries: libevent-1.4.s ...

  9. linux下设定动态库路径的命令-error while loading shared libraries: xxx.so.x错误的原因和解决办法

    网站:http://blog.chinaunix.net/uid-26212859-id-3256667.html 一般我们在Linux下执行某些外部程序的时候可能会提示找不到共享库的错误, 比如: ...

最新文章

  1. 【译】表变量和临时表的比较(转)
  2. 通过组策略和注册表关闭win7 UAC。
  3. Echart图表入门
  4. liferay spring mvc 案例地址
  5. hybris使用impEx导入产品主数据的示例脚本
  6. 突发!百度CEO李彦宏被当中泼了一瓶水,肇事者网名:直男上树
  7. 西门子s7-200解密软件下载_西门子S7-200/300/400通讯方式汇总,超级全面
  8. .net core高并发_高并发下的Node.js与负载均衡
  9. JS面试题-闭包异步-变量提升-引用传值-this
  10. 工厂支持多数据库开发的三层结构模式随笔(一)
  11. 助您写出优雅的Java代码七点建议
  12. HTML5 简介与安装
  13. 精密电阻选购及换算方法
  14. Ubuntu 安装 OpenRefine 并配置启动图标
  15. php语音直播怎么做,语音直播功能实现流程
  16. 伽罗华域(Galois Field)理解、基于伽罗华域的四则运算(附详细python代码)
  17. 干得漂亮!微信封禁大量色情账号
  18. Apache IoTDB 鼠年总结
  19. 重磅!2019年中国科学院院士增选当选院士名单公布
  20. 计算机网络中英互译,计算机网络中英文互译.doc

热门文章

  1. micropython控制舵机,Micropython之pwm控制舵机
  2. 刘泽云《计量经济学实验教程》笔记
  3. 怎么压缩动态图片?手机怎么压缩gif动图?
  4. surface pro win10 重装系统并解决屏幕亮度闪烁和降频的问题
  5. 朴素和KMP匹配算法(java)
  6. vue.js动态计时器_基于Vue.js的Pomodoro技术计时器
  7. 51单片机系列--闪烁灯,呼吸灯与流水灯
  8. 视觉SLAM十四讲从理论到实践第二版源码调试笔记(理论基础1-6章)
  9. the disk drive for uuid=XXXX ( /media/sda1) is not reday yet or not present
  10. tinyxml2库的使用