google protobuf@centos

 
  1. 下载:http://code.google.com/p/protobuf/downloads/list
  2. 安装:
    • unzip protobuf-2.5.0.zip
    • cd protobuf-2.5.0
    • ./configure 
    • make
    • make check 
    • make install
  3. java下编译protobuf:
    • 安装maven
    • cd protobuf-2.5.0/java
    • 按照README.txt编译,在target目录中生成protobuf-java-2.5.0.jar
    • 在elipse添加protobuf-java-2.5.0.jar:右键你的工程目录,最后一项属性Properties,第三项Java Build Path,右边选项卡第三项Libraries,然后Add External JARS
  4. c++下编译protobuf:
    • g++ -c filename.pb.cc
    • g++ -c filename.cpp
    • g++ filename.pb.o filename.o -lprotobuf

posted on 2013-10-30 15:50  唐装鼠  阅读(250)  评论(0)    收藏  举报

导航