1.https://github.com/google/protobuf/releases/tag/v3.0.0 下载需要的版本,如果执行autogen.sh的过程中出现autoreconf not found的错误,说明没有安装automake,在ubuntu执行sudo apt-get install automake libtool就可以了,其他平台根据实际情况安装。

  2.执行 go get -u github.com/golang/protobuf/{proto, proto-gen-go} ,

    执行go install github.com/golang/protobuf/proto

    go install github.com/golang/protobuf/protoc-gen-go  

  3.修改环境变量:

   export PATH=$PATH:/home/user/go/bin

  4.执行:protoc --go_out=. proto.proto 可以产生:proto.pb.go文件 放入工程中。

相关文章:

  • 2022-12-23
  • 2021-12-30
  • 2021-12-05
  • 2021-07-17
  • 2022-01-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-25
  • 2021-04-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案