【golang】linux 下安装protobuf

protocolbuffer
     简介:protocolbuffer(如下简称PB)是google 的一种数据交换的格式,它独立于语言,独立于平台linux


     一 , 编译安装c++

下载:[下载地址](https://developers.google.com/protocol-buffers/docs/downloads)
     解压后进入文件安装:
     ```bash
     ./autogen.sh
     ./configure
     make
     make check
     sudo make install
     ```
     校验:
     ```bash
     protoc --version
     ```git

若是make报错,以下 #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.github

能够安装二进制版本 bash

这里下载 对应版本的 ,https://github.com/google/protobuf/releases ui

是linux机器64位的,下载protoc-3.6.0-linux-x86_64.zipgoogle

下载完成后,解压,我下载解压到/usr/local/protoc中spa

获得bin和include目录 ,设置环境变量ip

vi /etc/profile get

export PATH=$PATH:/usr/local/go/bin:/usr/local/protoc/bin

保存,从新载入配置

source /etc/profile

#protoc --version
libprotoc 3.4.0

安装成功

相关文章
相关标签/搜索