1. 程式人生 > >Ubuntu 16.04 LTS 安裝libvips出現”Package vips was not found in the pkg-config search path”

Ubuntu 16.04 LTS 安裝libvips出現”Package vips was not found in the pkg-config search path”

arp dir exp export ron per gconf 部署 director

使用libvips來操作圖像,libvips的部署參考一個Node.js工程:https://github.com/lovell/sharp

在MAC下安裝很順利,到Linux環境下(Ubuntu 16.04 LTS)出現了如下問題:

# pkg-config --cflags vips vips vips vips
Package vips was not found in the pkg-config search path.
Perhaps you should add the directory containing `vips.pc‘
to the PKG_CONFIG_PATH environment variable
No package ‘vips‘ found

首先運行下vips -v看看libvips有沒有安裝成功,如果安裝沒問題的話,可能就是PKG_CONFIG_PATH環境變量問題,運行printenv PKG_CONFIG_PATH看看具體路徑,在我的電腦裏,當時竟然是空,當然會找不到libvips了。

參考了這個問題重新設置了下PKG_CONFIG_PATH,我又加了幾個路徑,最後:

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

Ubuntu 16.04 LTS 安裝libvips出現”Package vips was not found in the pkg-config search path”