下载protobuf-2.4.1.tar.gz:
http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.gz
安装:
tar zxvf protobuf-2.4.1.tar.gz
cd protobuf-2.4.1
./configure
sudo make
sudo make check
sudo make install
在安装过程中遇到不少问题 缺少 autoreconf 那就安装 autoreconf
brew install automake
Which should also install autoconf and allow rvm to finish installing.
如果没有brew 在安装brew linux 批量修改文件编码格式 这篇文章中又命令 安装 brew
error: possibly undefined macro: AC_PROG_LIBTOOL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
//安装libtool
sudo brew install libtool
On OS X, you may get an error:在mac中可能会穿线tr1/tuple 则修改 一下
./configure CPPFLAGS=-DGTEST_USE_OWN_TR1_TUPLE=1
在这个文件有个错误
找到文件src/google/protobuf/message.cc 在文件的第一个#include之上的一行,加入
#include <istream>