Reputation: 1012
Attempting to build an application based on OpenCV, I see two lines warning me of missing libraries for libjpeg
and libpng
. Here is an extract of the console output, which then goes on with a number of similar Qt-related issues.
/usr/bin/ld: warning: libjpeg.so.9, needed by /usr/local/lib/libopencv_imgcodecs.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libpng16.so.16, needed by /usr/local/lib/libopencv_imgcodecs.so, not found (try using -rpath or -rpath-link)
/usr/local/lib/libopencv_highgui.so: undefined reference to `QGraphicsView::viewportEvent(QEvent*)@Qt_5'
/usr/local/lib/libopencv_highgui.so: undefined reference to `QAbstractSlider::value() const@Qt_5'
Researching a bit around, I found out how to show which libraries and versions I have installed on my system using ldconfig -p | grep libjpeg
and ldconfig -p | grep libpng
. They gave me the following:
libjpeg.so.8 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libjpeg.so.8
libjpeg.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libjpeg.so
libpng12.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libpng12.so.0
and
libpng12.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpng12.so.0
libpng12.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libpng12.so
I clearly see I have an issue. The libraries installed on my computer are older than those required by OpenCV. However, I tried sudo apt install libjpeg-dev
, and to sudo apt update
but I haven't found the newer version being available.
Upvotes: 2
Views: 6415
Reputation: 51
For installing libjpeg9 Ubuntu 16.04
$ sudo apt-get install libjpeg9-dev
Upvotes: 0
Reputation: 1012
This is how to install libjpeg9
on Ubuntu 16.04:
sudo apt install libjpeg9-dev
Upvotes: 3