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

libxmlrpcpp not found

asked 2020-04-08 12:26:26 -0500

manuaatitya gravatar image

updated 2021-10-28 06:32:08 -0500

Mike Scheutzow gravatar image

Hi guys,

I'm trying to run a package with root privileges for the executable. I followed the steps as per the ROS answers page #q165246.

and set the setuid bit to run with root permissions. But when I try to run the package I get an error as follows :

$ rosrun master_test master_test_node
~/catkin_ws/devel/lib/master_test/master_test_node: error while loading shared libraries: cannot open shared object file: No such file or directory

I'm using ros melodic in my Ubuntu 18.04 machine.

I also tried checking my $PATH variable (/opt/ros/melodic/bin:) and $LD_LIBRARY_PATH (/opt/ros/melodic/lib) and both have been set correctly.

I'm not sure as to why the file in the /opt/ros/melodic/lib location doesn't get linked with my catkin_ws/devel/lib/package_name folder.

Any help with rectifying the issue is appreciated.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2021-10-28 01:43:33 -0500

pvl gravatar image

updated 2021-10-28 01:58:15 -0500

In my case sourcing the Ros distro's setup.bash helped. I am guessing that you need to source after you change to the root user. If you are using sudo your can also use sudo -E to preserve the environment.

The default sourcing command for linux (using bash) and your distro is:

sudo su # change to root user even if root doesn't have a password
source /opt/ros/melodic/setup.bash

In my case I simply forgot to source the environment. There were no elevated nodes involved. As I cannot test your case specifically I will describe what solved it for me. I have tested this on Noetic (my own distro). The linking went fine, but the classloader was unable to find and load the shared library ( That's the same error as in your case. The other answer suggests installing the libxmlrpcpp-dev package. This will install it to a location already on your path (for all users). It didn't fully solve my problem, because more libraries are missing.

edit flag offensive delete link more


@manuaatitya The link you reference warns you that environment variable LD_LIBRARY_PATH is going to get cleared, so it's no surprise that the ros libraries can not be found at run-time. @pvl provides one workaround, and a comment at the link provides another.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-10-28 06:25:06 -0500 )edit

answered 2020-11-10 10:24:12 -0500

sojin gravatar image

sudo apt install libxmlrpcpp-dev

edit flag offensive delete link more


Please explain why the -dev pkg is necessary. The library appears to be standard in ros_comm, and the user seems to imply they are having a run-time issue, not a build issue.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-10-28 06:13:48 -0500 )edit

Question Tools

1 follower


Asked: 2020-04-08 12:26:26 -0500

Seen: 2,075 times

Last updated: Oct 28 '21