up - ubuntu18.04安装protobuf-cpp

# system: ubuntu 18.04
# version: protobuf 3.9.1
> wget https://github.com/protocolbuffers/protobuf/releases/download/v3.9.1/protobuf-cpp-3.9.1.tar.gz
> tar zxvf protobuf-cpp-3.9.1.tar.gz  # -C 指定文件夹
> cd protobuf-3.9.1
> ./configure --prefix=/usr/local/protobuf
> make  # -j4表示指定4个进程同时编译
> make check
> sudo make install
> sudo vim /etc/profile
# 填入下面的内容
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/protobuf/lib
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/protobuf/lib
export PATH=$PATH:/usr/local/protobuf/bin
> source /etc/profile
> vim ~/.profile
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/protobuf/lib
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/protobuf/lib
export PATH=$PATH:/usr/local/protobuf/bin
> source ~/.profile

你可能感兴趣的:(ubuntu,linux,protobuf)