1

I've tried installing openCV 3.1.0 according to this guide on Ubuntu 14.04.1. But it yields to the following warning in the makestep:

/usr/bin/ld: warning: libpng16.so.16, needed by /home/smeik/anaconda2/lib/libQtGui.so.4, not found (try using -rpath or -rpath-link)

and subsequently a lot of messages of this type are created:

//home/smeik/anaconda2/lib/libQtGui.so.4: undefined reference to `png_create_read_struct@PNG16_0'

and in the end this error appears:

collect2: error: ld returned 1 exit status
make[2]: *** [bin/opencv_perf_core] Error 1
make[1]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2
make: *** [all] Error 2

Does anybody have an idea what to do in this situation? This is not because I do not have a Nvidia GPU, right?

Smyke
  • 21
  • I'd start by trying to figure out why cmake is finding anaconda's version of libQtGui.so.4 instead of the system's version – steeldriver Apr 11 '16 at 11:53
  • Well, I don't think the messages indicate that the system finds libQtGui.so.4 instead of libpng16.so.16, but that it does not find the libpng16.so.16 file at all. (I've checked, there are 2 files called libpng16.so.16: one in anaconda2/pkgs/libpng-1.6.17-0/lib/ and one in anaconda2/lib/. But I have no idea which one is the right one nor how to link them) – Smyke Apr 12 '16 at 09:36
  • That's not what I said: my point is it shouldn't be looking for ANYTHING in your $HOME/anaconda2 directory - if it uses the system version of the Qt lib, that should be linked with the system version of the PNG lib (which will probably be libpng12 for 14.04). BTW do you actually need the Qt GUI? If not, I suggest you follow the simpler instructions here – steeldriver Apr 12 '16 at 12:04
  • Tried that but it results in exactly the same warnings and error messages as described above. So do you know what is meant by try using -rpath or -rpath-link in the ld warning? And do you approximately know where in the system the QT lib should be? – Smyke Apr 13 '16 at 09:43
  • I can't find it documented anywhere, but it seems to require Qt5 (at least, if I set QT_SELECT=qt4 it appears to ignore it and use Qt5.2.1). I think the development metapackage is called qt5-default. NOTE: if you are trying to build python bindings FOR anaconda then please disregard everything I've said - I can't help you with that, sorry. – steeldriver Apr 13 '16 at 12:06
  • I've tried sudo apt-get install qt5-default and could install openCV more or less successfully. Meaning, that the error above does not show up anymore and the files are in place but the system does not find them (yes, I've set the path variables). So, I guess the question above is solved although my installation is not complete yet. – Smyke Apr 21 '16 at 07:31
  • Had the same issue on my server. Fixed it by installing qt5-default as suggested above. Thanks! – Kartos Jun 30 '16 at 03:32

0 Answers0