1

I am using a simulation software which is failing with the following error message :

[Err] [Plugin.hh:165] Failed to load plugin //Users/../catkin_ws/devel/lib/libgazebo_ros_paths_plugin.dylib: dlopen(//Users/../catkin_ws/devel/lib/libgazebo_ros_paths_plugin.dylib, 9): Library not loaded: libroslib.dylib
  Referenced from: //Users/../catkin_ws/devel/lib/libgazebo_ros_paths_plugin.dylib
  Reason: image not found
[Err] [Plugin.hh:165] Failed to load plugin //Users/../catkin_ws/devel/lib/libgazebo_ros_api_plugin.dylib: dlopen(//Users/../catkin_ws/devel/lib/libgazebo_ros_api_plugin.dylib, 9): Library not loaded: libroslib.dylib
  Referenced from: //Users/../catkin_ws/devel/lib/libgazebo_ros_api_plugin.dylib
  Reason: image not found

I looked at the application source code (in the Plugin.hh file) and I see that this message is coming from that line of code :

void *dlHandle = dlopen(fullname.c_str(), RTLD_LAZY|RTLD_GLOBAL);
if (!dlHandle)
{
    gzerr << "Failed to load plugin " << fullname << ": "
    << dlerror() << "\n";
    return result;
}

If I understand correctly the dlopen man, RTLD_LAZY should postpone the failure in case of missing symbol, so I assume that dlopen is not failing for that reason.

So what can be the reason of this failure ? Here is the output of otool on one of the library (if that helps) :

$ otool -L /Users/.../catkin_ws/devel/lib/libgazebo_ros_paths_plugin.dylib
/Users/...catkin_ws/devel/lib/libgazebo_ros_paths_plugin.dylib:
    /Users/.../catkin_ws/devel/lib/libgazebo_ros_paths_plugin.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/opt/gazebo6/lib/libgazebo.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_client.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_gui_building.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_gui_viewers.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_gui_model.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_gui.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_sensors.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_rendering.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_selection_buffer.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_physics_bullet.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_physics_simbody.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_physics_ode.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_physics.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_ode.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_transport.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_msgs.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_util.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_common.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_skyx.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_gimpact.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_opcode.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_opende_ou.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_math.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/gazebo6/lib/libgazebo_ccd.6.dylib (compatibility version 6.0.0, current version 6.5.1)
    /usr/local/opt/boost/lib/libboost_thread-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/opt/boost/lib/libboost_signals-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/opt/boost/lib/libboost_system-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/opt/boost/lib/libboost_filesystem-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/opt/boost/lib/libboost_program_options-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/opt/boost/lib/libboost_regex-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/opt/boost/lib/libboost_iostreams-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/opt/boost/lib/libboost_date_time-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/opt/protobuf/lib/libprotobuf.9.dylib (compatibility version 10.0.0, current version 10.1.0)
    /usr/local/opt/sdformat3/lib/libsdformat.3.dylib (compatibility version 3.0.0, current version 3.6.0)
    /usr/local/opt/ignition-math2/lib/libignition-math2.2.dylib (compatibility version 2.0.0, current version 2.2.3)
    /usr/local/opt/ogre/lib/libOgreMain.1.7.4.dylib (compatibility version 0.0.0, current version 1.7.4)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    libroslib.dylib (compatibility version 0.0.0, current version 0.0.0)
    libtf.dylib (compatibility version 0.0.0, current version 0.0.0)
    libtf2_ros.dylib (compatibility version 0.0.0, current version 0.0.0)
    libactionlib.dylib (compatibility version 0.0.0, current version 0.0.0)
    libmessage_filters.dylib (compatibility version 0.0.0, current version 0.0.0)
    libroscpp.dylib (compatibility version 0.0.0, current version 0.0.0)
    libxmlrpcpp.dylib (compatibility version 0.0.0, current version 0.0.0)
    libtf2.dylib (compatibility version 0.0.0, current version 0.0.0)
    librosconsole.dylib (compatibility version 0.0.0, current version 0.0.0)
    librosconsole_log4cxx.dylib (compatibility version 0.0.0, current version 0.0.0)
    librosconsole_backend_interface.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/opt/log4cxx/lib/liblog4cxx.10.dylib (compatibility version 11.0.0, current version 11.0.0)
    libdynamic_reconfigure_config_init_mutex.dylib (compatibility version 0.0.0, current version 0.0.0)
    libroscpp_serialization.dylib (compatibility version 0.0.0, current version 0.0.0)
    librostime.dylib (compatibility version 0.0.0, current version 0.0.0)
    libcpp_common.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/opt/console_bridge/lib/libconsole_bridge.0.2.dylib (compatibility version 0.2.0, current version 0.0.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)

EDIT : I understood that the missing library is actually libroslib.dylib, and if the "(compatibility version 0.0.0, current version 0.0.0)" is related to this, I guess that the issue will be the same with the other libraries (libtf...).

PS : env | grep DYLD returns nothing

PS2 : I was looking for a fix for the root cause, not a post fix as suggested with install_name in the other question (which i'm not duplicating).

LiohAu
  • 611
  • 12
  • 36
  • Does the `.dylib` file actually exist? If so what's it's CPU architecture (use `file` command from within shell)? What is the CPU architecture of the app? Is the app sandboxed? – trojanfoe Mar 15 '16 at 11:12
  • Yes the libgazebo_ros_paths_plugin.dylib exist : $ lipo -info /Users/../catkin_ws/devel/lib/libgazebo_ros_paths_plugin.dylib Non-fat file: /Users/../catkin_ws/devel/lib/libgazebo_ros_paths_plugin.dylib is architecture: x86_64 – LiohAu Mar 15 '16 at 11:13
  • What's with the `...catkin_ws` in the filename? – trojanfoe Mar 15 '16 at 11:13
  • the "..." is my username (which is my name), so I'm hiding it to anonymise my pastie :) – LiohAu Mar 15 '16 at 11:14
  • Well according to the error message `libroslib.dylib` is the culprit. Where is it on your system? It looks like it doesn't have it's *install name* configured correctly (see `install_name_tool`). – trojanfoe Mar 15 '16 at 11:20
  • Yes, that's what I just understood after posting. "libroslib.dylib" is the culprit, and I can't find it on my system :( – LiohAu Mar 15 '16 at 11:22
  • OK, so you've answered your own question. – trojanfoe Mar 15 '16 at 11:22
  • @trojanfoe: Finally I found the path of all these libraries, it's in /opt/ros/indigo/lib. Someone on IRC just suggested me to use the DYLD_LIBRARY_PATH env var is it the normal way ? – LiohAu Mar 15 '16 at 11:26
  • 1
    I think that will work, but it's a bit of a workaround. It's better to set the *install name* I reckon. – trojanfoe Mar 15 '16 at 11:28
  • Ok so install_name_tool is the way to fix things after compilation but how do I get things correctly linked since the begining (because I have done 17 install_name_tool calls and there are a lot remaining..) ? – LiohAu Mar 15 '16 at 12:53
  • Problem is being solved here : https://github.com/ros/catkin/pull/784 – LiohAu Aug 05 '16 at 12:13

0 Answers0