从源代码构建应用程序时如何使用特定的库?

从源代码构建应用程序时如何使用特定的库?

我正在尝试编译jpegoptim 来自源代码。当我尝试执行 ./configure 时,出现以下错误

Cannot find libjpeg or you have too old version (v6 or later required).

我想确认libjpeg.so

ldconfig -p | grep libjpeg

我的系统中有四个版本的库

libjpeg.so.62 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libjpeg.so.62
libjpeg.so.8 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libjpeg.so.8
libjpeg.so.8 (libc6) => /usr/lib/i386-linux-gnu/libjpeg.so.8
libjpeg.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libjpeg.so

dpkg -l | grep 'libjpeg.*-dev'

ii  libjpeg-dev:amd64                   8c-2ubuntu8                                                     amd64       Independent JPEG Group's JPEG runtime library (dependency package)
ii  libjpeg-turbo8-dev:amd64            1.3.0-0ubuntu2                                      amd64        Development files for the IJG JPEG library
ii  libjpeg8-dev:amd64                  8c-2ubuntu8                                         amd64        Independent JPEG Group's JPEG runtime library (dependency package)

如何使用 libjpeg.so.8 构建 jpegoptim?

答案1

在我的计算机上测试,安装libjpeg62-dev,就这样:

sudo apt-get install libjpeg62-dev

dpkg -l | grep 'libjpeg.*-dev'
ii  libjpeg62-dev:amd64  1:6b2-2  amd64  Development files for the IJG JPEG library (version 6.2)

ldconfig -p | grep libjpeg
    libjpeg.so.62 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libjpeg.so.62
    libjpeg.so.8 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libjpeg.so.8
    libjpeg.so.8 (libc6) => /usr/lib/i386-linux-gnu/libjpeg.so.8
    libjpeg.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libjpeg.so

相关内容