CentOS编译安装libzip最新版

编辑于 2021-05-16 00:22:39 阅读 2238

源自一个错误(安装php扩展: zip)

checking for libzip >= 0.11 libzip != 1.3.1 libzip != 1.7.0... no
configure: error: Package requirements (libzip >= 0.11 libzip != 1.3.1 libzip != 1.7.0) were not met:

No package 'libzip' found
No package 'libzip' found
No package 'libzip' found
或者是 yum install libzip-devel 完,提示版本过低

解决方案

#依赖
yum install bzip2-devel

cd /usr/local/src
wget https://libzip.org/download/libzip-1.7.3.tar.gz
tar -xvzf libzip-1.7.3.tar.gz 
cd libzip-1.7.3
mkdir build
cd build/
cmake -DCMAKE_INSTALL_PREFIX=/data/apps/libs ..
make && make install

#配置
export PKG_CONFIG_PATH=/data/apps/libs/lib64/pkgconfig:$PKG_CONFIG_PATH
#验证
pkg-config --list-all | grep libzip

广而告之,我的新作品《语音助手》上架Google Play了,欢迎下载体验