protobuf安裝、配置及錯誤解決
protobuf配置:https://blog.csdn.net/u012477435/article/details/80765005
安裝錯誤解決:https://blog.csdn.net/legend18/article/details/49840607
配置步驟:
1、git clone https://github.com/google/protobuf
2、自動生成configure配置檔案,執行:./autogen.sh
出錯:autogen.sh: line 8: autoreconf: command not found
解決方法:
curl -O http://mirrors.kernel.org/gnu/m4/m4-1.4.13.tar.gz
tar -xzvf m4-1.4.13.tar.gz
cd m4-1.4.13
./configure --prefix=/usr/local
make
sudo make installcd ..
curl -O http://mirrors.kernel.org/gnu/autoconf/autoconf-2.65.tar.gz
tar -xzvf autoconf-2.65.tar.gz
cd autoconf-2.65
./configure --prefix=/usr/local # ironic, isn't it?
make
sudo make install
cd ..這裡最好重啟下終端,以確保autoconf在接下來的指令碼中生效
curl -O http://mirrors.kernel.org/gnu/automake/automake-1.11.tar.gz
tar xzvf automake-1.11.tar.gz
cd automake-1.11
./configure --prefix=/usr/local
make
sudo make install
cd ..
curl -O http://mirrors.kernel.org/gnu/libtool/libtool-2.2.6b.tar.gz
tar xzvf libtool-2.2.6b.tar.gz
cd libtool-2.2.6b
./configure --prefix=/usr/local
makesudo make install
再重新執行:
./autogen.sh
3、配置環境:回到protobuf目錄下,./configure
4、編譯原始碼:make
make check
5、安裝:sudo make install
protoc --version