I am trying to compile the Point Cloud Library from source (http://pointclouds.org/). After running cmake and make, I receive the following linking error:
Linking CXX executable ../../bin/pcl_convert_pcd_ascii_binary
../../lib/libpcl_io.so.1.7.2: undefined reference to `png_set_longjmp_fn'
As a newbie, I'm not sure what this error means, but I am assuming: the executable file plc_convert_pcd_ascii_binary
which it is trying to build, needs to be linked to the library libpcl_io.so.1.7.2
, but this library contains the function png_set_longjump_fun
, and the definition of this function cannot be found?
So, I have tried looked at some similar questions on Stack Overflow, and it turns out that png_set_longjump_fun
is contained in the libpng
library, but was only introduced after libpng-1.4.x
. After running dpkg -l | grep libpng*
, I get the following output:
ii libpng12-0:amd64 1.2.50-1ubuntu2 amd64 PNG library - runtime
ii libpng12-dev 1.2.50-1ubuntu2 amd64 PNG library - development
So it looks like I need to upgrade from libpng12-dev
to at least libpng14-dev
. From the libpng website, I see that I can download the source for the latest version (but the latest version I can get through apt-get
is only libpng12-dev
). But I am worried that there may be some conflictions if I have one version installed via apt-get, and another version installed manually. However, uninstalling libpng12-dev
may cause issues if there are packages which depend on this, but are not compatible with the newer version.
Therefore, what I would like to know, is whether I should uninstall/purge libpng12-dev
, and then install the new version manually, or to simply install the new version whilst keeping the old version. And if I do the latter, how can I be sure that the PCL binary I am trying to compile, will link with this new library, rather than the old one?
Thanks :)