1下載地址: https://github.com/protocolbuffers/protobuf/releases
最好是下載-all的包,因爲裏面的依賴文件比較全,不然還需要下載各種依賴,可能會遇到各種報錯,我這裏下載的是3.11.2版本,自己根據情況下面對應的版本.
2如果下載最新的
git clone https://github.com/protocolbuffers/protobuf.git
3命令如下
sudo apt-get install autoconf automakers lib tool curl make g++ unzip cd Protobuf/ git submodule update --init --recursive sudo ./autogen.sh # 生成配置腳本 sudo ./configure # 生成Makefile文件,爲下一步的編譯做準備,可以加上安裝路徑:--prefix=path ,默認路徑爲 /usr/local/ sudo make # 從Makefile讀取指令 sudo make check # 可能會報錯 但是不影響 可以不執行此步 sudo make install sudo ldconfig # 更新共享庫緩存 which protocol # 查看軟件的安裝位置 proton --version # 檢查是否安裝成功