1. Download the protobuf file , for example version is , protobuf-2.4.1
2. Unzip in linux
3. Open the README.txt , we can see the make file.
4. look through the file. and follow the indication.
C++ Installation - Unix
=======================
To build and install the C++ Protocol Buffer runtime and the Protocol
Buffer compiler (protoc) execute the following:
$ ./configure
$ make
$ make check
$ make install
If "make check" fails, you can still install, but it is likely that
some features of this library will not work correctly on your system.
Proceed at your own risk.
"make install" may require superuser privileges.
For advanced usage information on configure and make, see INSTALL.txt.
5. Install location
** Hint on install location **
By default, the package will be installed to /usr/local. However,
on many platforms, /usr/local/lib is not part of LD_LIBRARY_PATH.
You can add it, but it may be easier to just install to /usr
instead. To do this, invoke configure as follows:
./configure --prefix=/usr
If you already built the package with a different prefix, make sure
to run "make clean" before building again.
6. In the proto***.proto directory, run the compile command
protoc -I=. --cpp_out=. Proto****.proto
*******************if filed ,try to do ******************
ldconfig
or
export LD_LIBRARY_PATH=/usr/local/lib
7. Get the result file in the current directory
Proto****.proto
Proto****.pb.h
Proto****.pb.cc
8. Enjoy it