admin管理员组

文章数量:1387287

I am currently using an C++ RPC framework (similar to gRPC) to implement the function, which itself depends on protobuf (v3.21.0) and is compiled using bazel(); at the same time, I need to use the libhdfs3 library, which also depends on protobuf. Since it is compiled using cmake, I choose to compile it locally, and then dynamically link libhdfs3 to protobuf (locally compiled with protobuf's so, and also using v3.21.0), but errors occurred after compilation.

[libprotobuf ERROR external/protobuf_archive/src/google/protobuf/descriptor_database:642] File already exists in database: google/protobuf/descriptor.proto
[libprotobuf FATAL external/protobuf_archive/src/google/protobuf/descriptor:1986] CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size): 
terminate called after throwing an instance of 'google::protobuf::FatalException'
  what():  CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size): 

I understand that the protobuf dependencies between the two have caused a conflict, how should it be resolved?

I ensure that the urls in the locally installed protobuf and rpc framework are the same (but there may be different compilation options?)

本文标签: protocol buffersC multiple library dependencies causing protobuf conflictsStack Overflow