installation process
-
Download software
Download the version you want to install: https://github.com/protocolbuffers/protobuf
download source code compilation:
system environment: Ubuntu16 (other versions are also available), Protobuf-3.6.1 -
Compile the source code
cd protobuf # 当使用 git clone 下来的工程中带有 submodule 时, # submodule 的内容并不会自动下载下来,此时,只需执 # 行如下命令,就可以下载,避免文件下载不全 git submodule update --init –recursive ./autogen.sh ./configure make sudo make install sudo ldconfig # refresh shared library cache.
protoc --version(编译完成,查看版本,表示成功安装)
After the compilation is complete, the installation location of the relevant files is shown in the following figure:
/usr/local/lib: static library and dynamic library
/usr/local/bin: executable files
/usr/local/include/google: header files
The content of the google folder is shown in the figure below, which contains related header files