google protobuf 安装方法:
下载:
https://github.com/google/protobuf/releases --> protobuf-all-3.6.0.zip
编译安装流程(注意加上sudo防止创建目录权限不足):
unzip protobuf-all-3.6.0.zip
cd protobuf-all-3.6.0
./autogen.sh
./configure --prefix=/usr/local/protobuf
(https://www.cnblogs.com/darkknightzh/p/5782992.html ./configure --prefix=/usr)
sudo make -j8 && sudo make install
ldconfig
环境变量配置:
sudo gedit ~/.bashrc
添加: PATH=/usr/local/protobuf/bin:$PATH
(如果findpackage报错注意添加lib和include到环境变量)
source ~/.bashrc
网友评论