ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
3

´libroscpp.so: cannot open shared object file: No such file or directory´ Error

asked 2020-03-12 07:20:37 -0600

kopop8 gravatar image

updated 2020-03-12 07:59:08 -0600

gvdhoorn gravatar image

I have a Turtlebot3 WIth ROS Kinetic and Linux 16.04

Everything was working fine until i had trouble installing a python bluetooth library. when the library finally worked it broke ROS. (Atleast i think that broke it) When i try to run the command roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch or roscore i now get the error

/opt/ros/kinetic/lib/rosout/rosout: error while loading shared libraries: libroscpp.so: cannot open shared object file: No such file or directory
process[rosout-1]: started with pid [5196]
[rosout-1] process has died [pid 5196, exit code 127, cmd /opt/ros/kinetic/lib/rosout/rosout __name:=rosout __log:=/home/pieter/.ros/log/7ffad4de-6459-11ea-bb82-4074e0a32f05/rosout-1.log].
log file: /home/pieter/.ros/log/7ffad4de-6459-11ea-bb82-4074e0a32f05/rosout-1*.log

In this forum i read it´s probably because the LD_LIBRARY_PATH changed or that some link is wrong. When i echo it returns /home/pieter/catkin_ws/devel/lib:/opt/ros/kinetic/lib:/opt/ros/kinetic/lib/x86_64-linux-gnu what seems right.

when run rospack find roscpp it return /opt/ros/kinetic/share/roscpp and when i run rospack find libroscpp i can´t find the package. /opt/ros/kinetic/lib contains libroscpp.so

ldd /opt/kinetic/lib/rosout/rosout returns:

/lib64/ld-linux-x86-64.so.2 (0x00007f8a73435000)
libapr-1.so.0 => /usr/lib/x86_64-linux-gnu/libapr-1.so.0 (0x00007f8a6fe05000)
libaprutil-1.so.0 => /usr/lib/x86_64-linux-gnu/libaprutil-1.so.0 (0x00007f8a6fbde000)
libboost_chrono.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_chrono.so.1.58.0 (0x00007f8a7145f000)
libboost_filesystem.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0 (0x00007f8a71247000)
libboost_regex.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_regex.so.1.58.0 (0x00007f8a70444000)
libboost_system.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0 (0x00007f8a7188d000)
libboost_thread.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.58.0 (0x00007f8a71667000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8a71eb8000)
libconsole_bridge.so.0.2 => /usr/lib/x86_64-linux-gnu/libconsole_bridge.so.0.2 (0x00007f8a70037000)
libcpp_common.so => /opt/ros/kinetic/lib/libcpp_common.so (0x00007f8a71a91000)
libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f8a6eda7000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f8a6efdf000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f8a6eb7e000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f8a72282000)
libicudata.so.55 => /usr/lib/x86_64-linux-gnu/libicudata.so.55 (0x00007f8a6d0c7000)
libicui18n.so.55 => /usr/lib/x86_64-linux-gnu/libicui18n.so.55 (0x00007f8a6f77c000)
libicuuc.so.55 => /usr/lib/x86_64-linux-gnu/libicuuc.so.55 (0x00007f8a6f3e8000)
liblog4cxx.so.10 => /usr/lib/x86_64-linux-gnu/liblog4cxx.so.10 (0x00007f8a7074c000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f8a70f3e000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f8a7281a000)
librosconsole.so => /opt/ros/kinetic/lib/librosconsole.so (0x00007f8a72e67000)
librosconsole_backend_interface.so => /opt/ros/kinetic/lib/librosconsole_backend_interface.so (0x00007f8a70b23000)
librosconsole_log4cxx.so => /opt/ros/kinetic/lib/librosconsole_log4cxx.so (0x00007f8a70d25000)
libroscpp.so => /opt/ros/kinetic/lib/libroscpp.so (0x00007f8a73099000)
libroscpp_serialization.so => /opt/ros/kinetic/lib/libroscpp_serialization.so (0x00007f8a72c64000)
librostime.so => /opt/ros/kinetic/lib/librostime.so (0x00007f8a72a37000)
librt.so ...
(more)
edit retag flag offensive close merge delete

Comments

Reinstalling ROS doesnt work either

kopop8 gravatar image kopop8  ( 2020-03-12 08:23:41 -0600 )edit

I have the same kinda issue on 2 different computer using ROS1 and ROS2...

Rextab gravatar image Rextab  ( 2020-11-26 09:23:51 -0600 )edit

3 Answers

Sort by » oldest newest most voted
1

answered 2020-11-26 06:31:21 -0600

Rextab gravatar image

updated 2020-11-26 09:26:26 -0600

I found a potential solution for you see: https://answers.ros.org/question/3663...

edit flag offensive delete link more

Comments

This fixed my problem, see https://answers.ros.org/question/3663...

CodeFinder gravatar image CodeFinder  ( 2021-06-08 08:31:13 -0600 )edit

quoting the solution from the above link : "Indeed, thank you so much for this! A setcap on my Python executable was the reason for rosout terminating immediately due to not finding libroscpp.so (although properly installed, Ubuntu 20.04, ROS1 noetic). Was able to fix it with sudo setcap -r /usr/bin/python3.8"

aks gravatar image aks  ( 2023-02-23 07:28:27 -0600 )edit
2

answered 2021-07-18 10:26:29 -0600

mobiiin gravatar image

add this line to your bashrc file: it should be added last,otherwise it doesn't work

export LD_LIBRARY_PATH=/opt/ros/kinetic/lib
edit flag offensive delete link more
1

answered 2022-08-25 10:11:12 -0600

130s gravatar image

If this answer that suggests adding LD_LIBRARY_PATH to the lib folder under ROS' install directory, then you should run source /opt/ros/%YOUR_ROS_DISTRO%/setup.bash (in your example, %YOUR_ROS_DISTRO%=kinetic) and see if it resolves.

setup.bash sets up number of things on your terminal for ROS, including setting up an environment variable LD_LIBRARY_PATH. See http://wiki.ros.org/ROS/Tutorials/Ins...

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2020-03-12 07:20:37 -0600

Seen: 11,073 times

Last updated: Aug 25 '22