Qt运行功能包error while loading shared libraries: libxxx.so

问题:

在导入cmakelist之后运行功能包出现找不到动态链接库

error while loading shared libraries: libxmlrpcpp.so: cannot open shared object file: No such file or directory
error while loading shared libraries: librosconsole_log4cxx.so: cannot open shared object file: No such file or directory

原因:

Qt只加载了其包含的一个库,没有将ros里边相关的库包含进去

环境配置

  • ros-melodic
  • ubuntu18.04
  • Qt5.9.9

解决办法

  1. 打开终端,安装第一个库
sudo apt install libxmlrpcpp-dev
  1. 链接其他库
  • 打开ld.so.conf
vi /etc/ld.so.conf
  • include ld.so.conf.d/*.conf下边换行添加/usr/local/libopt/ros/melodic/lib
  • 添加好后保存退出,还需要将文件/etc/ld.so.conf列出的路径下的库文件缓存到/etc/ld.so.cache以供使用
/sbin/ldconfig -v
  • 接着执行
ldconfig

之后就可以重新导入Cmakelist文件进行运行

  • 3
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值