一捷犹、下載包 protobuf-2.5.0.tar.gz
https://github.com/protocolbuffers/protobuf/releases/tag/v2.5.0
二、解壓包并修改文件platform_macros.h
./src/google/protobuf/stubs/platform_macros.h
增加下面這三行內(nèi)容
#elif defined(__arm64__)
#define GOOGLE_PROTOBUF_ARCH_ARM 1
#define GOOGLE_PROTOBUF_ARCH_64_BIT 1
//定位到下面這兩行
#else
#error Host architecture was not detected as supported by protobuf
三、安裝命令
./configure //默認(rèn)安裝到/usr/local
make
make check
sudo make install
protoc --version //查看是否安裝成功
四牡辽、卸載
$ which protoc
/usr/local/bin/protoc
$ sudo rm /usr/local/bin/protoc