mac安装protoc

1.确认MAC装有g++、make、vim工具

2.安装make工具使用brew install make

3.去https://github.com/google/protobuf/releases下载对应的buf

编译:

./autogen.sh  在运行 ./configure 接着运行make,结束后在运行make install

注释:

./autogen.sh是获取GoogleMock,并生成对应的configure脚本

./configure是进行环境检测,并生成对应的makefile或Makefile--prefix=/usr/local可以指定安装路径

make,按照makefile编译工程

make install,执行makefile里面的install部分,进行安装--prefix=/usr/local可以指定安装路径

安装完成后版本查看: protoc --version

你可能感兴趣的:(mac安装protoc)