Ubuntu Protobuf installation (test works)

installation process

  1. Download software

    Download the version you want to install: https://github.com/protocolbuffers/protobuf
    download source code compilation:
    insert image description here
    system environment: Ubuntu16 (other versions are also available), Protobuf-3.6.1

  2. 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(编译完成,查看版本,表示成功安装)
    

    insert image description here

    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
    insert image description here

    /usr/local/bin: executable files
    insert image description here

    /usr/local/include/google: header files
    insert image description here
    The content of the google folder is shown in the figure below, which contains related header files
    insert image description here

Guess you like

Origin blog.csdn.net/kxh123456/article/details/129444422