protobuf的使用
google下载protobuf,http://code.google.com/p/protobuf/downloads/list
protobuf-2.4.1.tar.bz2
?
#tar jxvf protobuf-2.4.1.tar.bz2
#cd?protobuf-2.4.1
#./configure
#make
#sudo make install
?
运行,ubuntu下默认报错
protoc: error while loading shared libraries: libprotobuf.so.7: cannot open shared object file: No such file or directory
protoc: error while loading shared libraries: libprotoc.so.7: cannot open shared object file: No such file or directorypackage tutorial;option java_package = "com.example.tutorial";option java_outer_classname = "AddressBookProtos";message Person { required string name = 1; required int32 id = 2; optional string email = 3; enum PhoneType { MOBILE = 0; HOME = 1; WORK = 2; } message PhoneNumber { required string number = 1; optional PhoneType type = 2 [default = HOME]; } repeated PhoneNumber phone = 4;}message AddressBook { repeated Person person = 1;}?具体意思见http://code.google.com/intl/zh-CN/apis/protocolbuffers/docs/javatutorial.html?
?