1:用git 把google buffer源码从github上拉下来,网络不好的请自行修改host改成最新的
2:编译,先装c++得编译器
注意: . /autogen.sh,一开始楼主没有运行这个命令,直接运行./configure ,一直没有反应,找了N多文章,浪费了一天时间,
按照下面的命令 1:./autogen.sh 2:make 3:make check 4:sudo make install ;
make install 通过之后记得查看一下是否安装成功:protoc --version ,出现版本号就ok了,否则继续 sudo make install
If you get the source from github, you need to generate the configure script first:
$ ./autogen.sh
This will download gmock source (which is used for C++ Protocol Buffer unit-tests) to the current directory and run automake, autoconf, etc. to generate the configure script and various template makefiles.
You can skip this step if you are using a release package (which already contains gmock and the configure script).
To build and install the C++ Protocol Buffer runtime and the Protocol Buffer compiler (protoc) execute the following:
$ ./configure
$ make
$ make check
$ make install