一、关于protobuf
二、下载
https://github.com/protocolbuffers/protobuf/releases/tag/v2.5.0
三、编译准备
下载完protobuf后,需要对其进行编译以生存protoc.exe执行文件。解压protobuf压缩包后,阅读README.txt文件,README里有介绍unix下及windows下如何编译。
unix下需要安装gcc、cmake等库。如果要在windows下使用unix下的编译方式,需要借助于cygwin或MinGW,我们使用cygwin。
windows系统没有cygwin或mingw的话,需要使用visual studio。此时,安装visual studio,配置C/C++环境。
3.1安装Cygwin
3.2安装必要套件
通过cygwin安装gcc、cmake。
四、编译
阅读README.txt文件,按说明进行编译。编译后,在cygwin的目录下usr/local/bin目录下生存protoc.exe可执行文件。这个文件需要在cygwin的虚拟环境中才能运行。