Robotics StackExchange | Archived questions

undefined reference to `inflateValidate@ZLIB_1.2.9' when making navigation stack

Hi, I'm trying to build the navigation stack. I've installed all the dependencies and cloned the the github repository. When I run catkin_make I get the following error at 95%:

/home/kwint/anaconda3/lib/libpng16.so.16: undefined reference to `inflateValidate@ZLIB_1.2.9'
collect2: error: ld returned 1 exit status
navigation/navfn/CMakeFiles/navtest.dir/build.make:508: recipe for target '/home/kwint/catkin_ws/devel/lib/navfn/navtest' failed. 
make[2]: *** [/home/kwint/catkin_ws/devel/lib/navfn/navtest] Error 1
CMakeFiles/Makefile2:13985: recipe for target 'navigation/navfn/CMakeFiles/navtest.dir/all' failed

I'm not sure what this error means, is something wrong the python module libpng? Could this be because I use anaconda?

I'm on Ubuntu (GNOME) 16.04 with kinetic. I installed ROS with http://wiki.ros.org/kinetic/Installation/Ubuntu

Asked by kwint on 2018-03-19 07:14:57 UTC

Comments

Please always include what arch this is, what OS you are running, how you installed ROS, etc when reporting build errors.

From the path shown in the error message I see you are using Anaconda. Does the same problem occur when you don't have that on your path?

Asked by gvdhoorn on 2018-03-19 09:48:55 UTC

I would recommend to build navigation with Anaconda off the (lib search) path(s) in any case, as the rest of ROS is most likely not linked to that version of libpng either, and that could cause binary incompatibilities.

Asked by gvdhoorn on 2018-03-19 11:26:14 UTC

I've removed anaconda libpng from anaconda and now builds without errors, but this workaround, not a fix. I've removed anaconda from $PATH, but no result. How do I stop cmake to look in the anaconda package? (The zlib package in anaconda is version 1.2.11, i think that's the problem btw)

Asked by kwint on 2018-03-19 16:12:10 UTC

but this workaround, not a fix.

no, it is a fix. The problem is that while building, the libs provided by Anaconda take precedence, but they should not be on the search path in the first place.

As to how to configure Anaconda for use with ROS, please see the myriad of questions about that.

Asked by gvdhoorn on 2018-03-20 02:46:57 UTC

Answers

First of all check that you sourced in your current terminal Conda (so that you can use conda)

Therefor a line like this one should be contained in your bashrc and be uncommented:

export PATH="/home/markus/anaconda3/bin:$PATH"

Next type:

conda remove libpng

Then comment in your bashrc this line:

export PATH="/home/markus/anaconda3/bin:$PATH"

Open a new terminal (STR+ALT+T) and try to cakin build your code again. This helped in my case

However if it does not you can try other options like :

cd /usr/lib/x86_64-linux-gnu
sudo ln -s ~/anaconda/lib/libpng16.so.16 libpng16.so.16
sudo ldconfig

But they did not help me ....

Asked by Markus on 2018-05-10 07:33:22 UTC

Comments

do not build code again. Your compiled code only needs libpng. Remove from conda and then run sudo apt-get install libpng16-16. This is enough. Just got this error resolved.

Asked by saurabheights on 2018-10-30 20:08:06 UTC