I recently tried protobuf many times but failed to use it. I used ubuntu. protobuf also used many versions under the virtual machine, but it was not successful. In the end, version 250 is used to complete the configuration. First get pr
I recently tried protobuf many times but failed to use it. I used ubuntu. protobuf also used many versions under the virtual machine, but it was not successful. The final version is 2.5.0.
Sort out the configuration process.
First, obtain the package file corresponding to protobuf. enter the following on the terminal:
wget http://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gz
Decompress the downloaded package
tar zxvf protobuf-2.5.0.tar.gz
Go to the extract Directory
cd protobuf-2.5.0
Run
./configure
Errors may occur in the middle. it is estimated that G ++ is not properly installed because compilation is required during installation.
Install G ++
apt-get install g++
In addition, it is best to install Vim and make. otherwise, problems may occur in the future. I have not mentioned these in other tutorials. I would like to share my personal experience with you.
apt-get install vim
apt-get install make
./After configure is successful, perform the following steps:
make make checkmake install
Run the command on the terminal after installation.
vim ~/.profile
Open the configuration file and add
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
Save and exit, and then execute
source ~/.profile
Is the configuration file modification takes effect, the last execution
protoc --version
Check the protobuf version to test whether the installation is successful.
The following links can be used for subsequent operations. they are well written.
Http://hahaya.github.io/2013/08/12/use-protobuf-in-c-plus-plus.html
Http://www.ccvita.com/507.html