1, Protobuf is Google's proposed data storage format, detailed introduction can refer to: https://code.google.com/p/protobuf/
2, download the latest protobuf,:https://code.google.com/p/protobuf/downloads/list
3, download PROTOBUF2.5.O version, protobuf-2.5.0.tar.gz decompression and installation.
Decompression: Tar xvf protobuf-2.5.0.tar.gz
Installation steps: (1)./configure (2) make (3) make check (4) make install
Note: After successful installation, add its bin and Lib directories separately to the path and LD_LIBRARY_PATH environment variables to facilitate direct invocation.
It is generally recommended to install to the/usr/local directory, and when performing configure, specify--PREFIX=/USR/LOCAL/PROTOBUF to
To set the environment variable procedure: Edit the/etc/profile and add it at the end of the file:
Export path= $PATH:/usr/local/protobuf/bin export ld_library_path= $LD _library_path:/usr/local/protobuf/lib
4. Test Example:
Create a. proto file with the file: X.proto
1Package x;2Message Person3 { 4RequiredstringName =1; 5Required Int32 id =2; 6Optionalstringemail =3; 7 }
Http://www.ibm.com/developerworks/cn/linux/l-cn-gpb/http://www.hadoopor.com/thread-1837-1-1.html
Centos6.4 installation protobuf and simple use