linux 源码编译 libvips

编译libvips前需要安装的其他包

centos

yum install gcc-c++ glib2-devel libpng-devel libjpeg-devel libtiff-devel expat-devel fftw3-devel libimagequant-devel -y

ubuntu

apt-get update
apt-get install libglib2.0-dev libpng-dev libjpeg-dev libtiff-dev libexpat1-dev libfftw3-dev libimagequant-dev -y

安装 libvips

下载源码 https://github.com/libvips/libvips/releases 后解压

wget https://github.com/libvips/libvips/releases/download/v8.12.2/vips-8.12.2.tar.gz

tar -xf vips-8.12.2.tar.gz

cd vips-8.12.2

注意看输出结果,少了lib记得装

./configure
make && make install

find /usr/local/ -iname "*vips*"

ldconfig

# vips -v
vips-8.12.2-Tue Jan 25 09:34:32 UTC 2022

设置 PKG_CONFIG_PATH

编辑/etc/profile

export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/share/pkgconfig:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig

查看PKG_CONFIG_PATH是否生效

source /etc/profile

pkg-config --cflags vips
-I/usr/local/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/libpng16

See also:

posted @ 2022-07-26 11:27  Ajanuw  阅读(785)  评论(0编辑  收藏  举报