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

Revision history [back]

I am not sure why this happens sometimes, I have recently seen it even when I built gazebo from scratch.

The reason is that the version of libpng used by either gzclient it self or one of the dependencies are not correctly compiled and linked, so the version linked is not the one used when compiling....

I don't intend to spend more time investigating how this happened, but it could relate to openCV shipping with libpng 1.2.46 and referring to it directly in headers, while the default installed in ubuntu 11 and upwards is libpng 1.5.4

try:

ldd /usr/...../gzclient

and see if it attempts to use libpng.so or libpng.12.so, you want it to use the older version "libpng.so", and it can be installed by:

sudo apt-get install libpng3

however that will not solve you'r problem as the program still attempts to load the library it was linked to.

This can be circumvented after installing the extra libpng in ubuntu by running the client like this:

LD_PRELOAD=/usr/lib/i386-linux-gnu/libpng.so gzclient

that loads the libpng from the version required, before resolving the dynamically linked libraries. In principle when the stuff in a library is loaded once, it is not necessesary to load it again, and most programs will then use the library pre-loaded.

This trick will not work for all programs, as a security risk is introduced when allowing the user to manually choose libraries (and perhaps reimplement them), but it will work for gzclient on ubuntu.