tar-xvf
./configure--prefix=/usr/local/protobuf-2.5.0
make
makeinstall
安装成功后可将编译程序链接到系统bin目录下,以免每次使用都加绝对路径
ln-s
linux安装完成!
使用步骤:
新建*.proto文件,并调用命令:protoc --cpp_out= *.proto编译即可生成C++的.h和cpp文件。
原文地址:http://blog.sina.com.cn/s/blog_52ff416e0101hv71.html