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

ROS/NXT Error loading shared packages

asked 2011-10-18 20:01:51 -0500

Flynnn gravatar image

updated 2014-01-28 17:10:36 -0500

ngrennan gravatar image

Long story short... I am trying to get ROS set up to work with my NXT

I've been following the NXT ROS tutorials, and everyhting was going merrily until it came time to create urdf files and visualize them.

Tutorial link:

I managed to create what appears to be a valid urdf file, however, the tutorial says to run the following:

roslaunch learning_nxt robot.launch

after adding the following to the robot.launch file:

<param name="robot_description" textfile="$(find learning_nxt)/robot.urdf"/>

  <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher">
    <param name="publish_frequency" value="100.0"/>

The robot.launch file works FINE without that added text. However, with the text in there, this happens:

started roslaunch server http://ubuntu:55334/


 * /rosversion
 * /rosdistro
 * /robot_description
 * /robot_state_publisher/publish_frequency
 * /nxt_ros/nxt_robot

    robot_state_publisher (robot_state_publisher/state_publisher)
    nxt_ros (nxt_ros/
    joint_state_publisher (nxt_ros/


core service [/rosout] found
process[robot_state_publisher-1]: started with pid [5731]
/opt/ros/electric/stacks/robot_model/robot_state_publisher/bin/state_publisher: error while loading shared libraries: cannot open shared object file: No such file or directory
process[nxt_ros-2]: started with pid [5732]
[robot_state_publisher-1] process has died [pid 5731, exit code 127].
log files: /home/george/.ros/log/2c870166-fa26-11e0-abfd-000c29128eed/robot_state_publisher-1*.log

Mainly note the last few lines....

/opt/ros/electric/stacks/robot_model/robot_state_publisher/bin/state_publisher: error while loading shared libraries: cannot open shared object file: No such file or directory

I am deeply confused as to why this is happening, and I can't seem to find any solution. Please, can anyone help? Thankyou :)

EDIT: Same error when excecuting

rosrun rviz rviz
edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted

answered 2011-10-19 06:22:03 -0500

Flynnn gravatar image

Hi :) last night I was effed in the mind... Simply tiiirreed.

This morning, something occurred to me: Check out what a shared library even is!

Turns out, longsotry short, they are special kinds of libraries that programs automagically install. What is interesting about them is that different libraries can use older versions of the same library. How is this possible? Through their naming system! is different than!

So, it occured to me, there were two possibilities! EITHER: I do not have libtinyxml installed, OR: ROS wants to use a version that I do not have installed, and ROS is refusing to install the correct version.

Turns out, it was the latter.

I went into my /usr/libs directory, and searched for libtinyxml. Guess what I found?

Notice that ROS wants to use

Now I have no idea why ROS is not attempting to update the tinyxml file, but I do believe that the answer to my issues are either:

To rename to OR Upgrade to

I hope this helps anyone who comes across similar issues. If you are getting a "Shared library could not be loaded" issue, go to your usr/lib directory, and use the search function to search for the name of the library (Name being the part that comes BEFORE the .so.x.x.x part).

Some .so files should appear (If they do not, you do not have what ROS wants. Skip down to the bottom for help). Check these versions against the version the version that is being showed in the error (version is seen in the so.x.x.x part). If these versions do not match, you know you have a problem.

The solution to this problem varies:

If ROS wants an OLDER version of what you have, just duplicate the oldest version you own, and rename it to what your ROS wants. Libraries are commonly backwards compatible, and WILL support deprecated operations for a while, for this reason exactly.

If ROS wants a NEWER version, seek help on updating that version. I suggest going to the website that publishes the library you wish to upgrade, and then seeing if it has an install page. If it does not have a legible method of installation, attempt to get help on either an IRC, or help system like this one.

If yo don't have what ROS wants at all... Then just install what ros wants like you normally would, and then repeat the above steps if it still does not work.

edit flag offensive delete link more


It worked :) When I tried to update libtinyxml (sudo apt-get libtinyxml-dev) it did told me I was up to date (hmm..) So I instead cd'ed to my /usr/lib, and then ran the command: sudo cp (to copy and rename the library) It worked like a charm! :D
Flynnn gravatar image Flynnn  ( 2011-10-19 06:32:31 -0500 )edit

answered 2011-11-07 23:26:19 -0500

I had the same issue, and I've created a symbolic link which seems to be a more proper way to overcome this problem since copying with a different version name can be misleading later on.

ln -s </path/to/file> <soft_link>


edit flag offensive delete link more


Agreed that symbolic linking is more proper in this case, and this worked out for my environment.
130s gravatar image 130s  ( 2011-12-17 17:19:39 -0500 )edit

answered 2011-11-04 08:32:59 -0500

Dave Coleman gravatar image

updated 2011-11-04 08:33:43 -0500

I had basically the same issue:

/opt/ros/electric/stacks/robot_model/urdf_parser/bin/check_urdf: error while loading shared libraries: cannot open shared object file: No such file or directory

So I simply ran:

cd /usr/lib


I don't know much about why the dependencies aren't installing correctly, but that worked for me on Ubuntu 11.04 using Electric

edit flag offensive delete link more

answered 2012-03-07 08:05:01 -0500

ElCid gravatar image

thanks people it helped just rename the file :)

edit flag offensive delete link more

Question Tools


Asked: 2011-10-18 20:01:51 -0500

Seen: 1,793 times

Last updated: Mar 07 '12