如何在Ubuntu 16.04中从libjpeg.so.8更新到libjpeg.so.9?

时间:2018-03-17 22:34:17

标签: opencv ubuntu-16.04 libpng libjpeg

尝试基于OpenCV构建应用程序时,我看到两行警告我libjpeglibpng缺少库。这是控制台输出的摘录,然后继续讨论许多与Qt相关的问题。

/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'

稍微研究一下,我发现如何使用ldconfig -p | grep libjpegldconfig -p | grep libpng显示我在系统上安装了哪些库和版本。他们给了我以下内容:

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

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

我清楚地看到我有一个问题。我的计算机上安装的库比OpenCV所需的库旧。但是,我尝试sudo apt install libjpeg-devsudo apt update,但我还没有找到新版本。

2 个答案:

答案 0 :(得分:1)

用于安装libjpeg9 Ubuntu 16.04

$ sudo apt-get install libjpeg9-dev

答案 1 :(得分:0)

这是在Ubuntu 16.04上安装libjpeg9的方法:

sudo apt install libjpeg9-dev