Mac安装Protobuf

  1. 下载Protobuf
  2. 解压:
    tar -zxf protobuf-3.13.0
    
  3. 设置编译目录
    cd protobuf-3.13.0
    ./configure --prefix=/usr/local/protobuf
    
  4. 安装:
    make
    make install
    
  5. 添加配置
    # 返回根目录
    cd 
    vim .bash_profile
    
    添加配置
    export PROTOBUF=/usr/local/protobuf
    export PATH=$PROTOBUF/bin:$PATH
    
    提交配置:source .bash_profile
  6. 测试: protoc --version
    protoc --version
    libprotoc 3.13.0
    

results matching ""

    No results matching ""