protobuf 误装了其他版本之后,我之前的3.6.1,就找不到了,现在按照源码安装的方式,进行安装,成功
1.卸载
sudo apt-get remove libprotobuf-dev
which protoc
然后删除路径即可
2.安装
sudo apt-get install autoconf automake libtool curl make g++ unzip
git clone -b v3.6.1 https://github.com/protocolbuffers/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
./configure
make
make check
sudo make install
sudo ldconfig
protoc --version 输出版本号成功