CentOS 编译错误:configure: error: Package requirements (protobuf >= 2.6.0) were not met - 解决方法
这个错误提示是因为系统缺少 protobuf 库,需要先安装 protobuf 库才能继续编译。可以使用 yum 命令安装:
sudo yum install protobuf protobuf-devel
如果还是出现类似的错误提示,可以尝试设置 PKG_CONFIG_PATH 环境变量,例如:
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
或者设置 protobuf_CFLAGS 和 protobuf_LIBS 环境变量,例如:
export protobuf_CFLAGS='-I/usr/local/include'
export protobuf_LIBS='-L/usr/local/lib -lprotobuf'
如果以上方法都不行,可以尝试手动编译安装 protobuf 库。
原文地址: https://www.cveoy.top/t/topic/nlnh 著作权归作者所有。请勿转载和采集!