grpc版本是1.33.2;protoc版本是3.13.0 官网对应的 编译报错: #error: This file was generated by a newer version of protoc which is
时间: 2024-03-10 21:47:42 浏览: 206
grpc-1.33.2 Qt mingw730_64 编译静态库
incompatible with your Protocol Buffer headers. This error occurs when the version of protoc that was used to generate the .pb files is newer than the version of protoc that is installed on your system.
To solve this issue, you can try upgrading your version of protoc to match the version that was used to generate the .pb files. Alternatively, you can regenerate the .pb files using the version of protoc that is installed on your system.
To regenerate the .pb files, you can use the following command:
```
protoc --grpc_out=. --plugin=protoc-gen-grpc=/usr/local/bin/grpc_cpp_plugin --cpp_out=. your_proto_file.proto
```
Replace `your_proto_file.proto` with the name of your .proto file, and `/usr/local/bin/grpc_cpp_plugin` with the path to your `grpc_cpp_plugin` binary.
阅读全文