This might seem like an odd pattern, but I'm looking to retrofit an existing client/server framework with gRPC. That has led me to a question and an issue.
FIrst, the question. The "Use Server Reflection in a C++ Client" secion of the
Server Reflection Tutorial mentions using the grpc::ProtoReflectionDescriptorDatabase class as the basis of that interaction. That seems to require me to link in libgrpc++_proto_reflection_desc_db.a which as far as I can tell has no "install" option in the makefile provided. Is staticlly linking it from the grpc/lib/opts directory the recomended pattern or am I missing something?
To try things out I went ahead and linked it into my client/server framework library directly. However, from there I'm having issues getting my test server to startup when linking in both my client/server dynamic library (that statically links libgrpc++_proto_reflectin_desc_db.a) and libgrpc++_reflection.so. The error in question is this:
[libprotobuf ERROR google/protobuf/descriptor_database.cc:58] File already exists in database: src/proto/grpc/reflection/v1alpha/reflection.proto
[libprotobuf FATAL google/protobuf/descriptor.cc:1358] 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'm planning to continue digging in to see if I can figure out why that's an issue, but the comment foujnd in descriptor.cc around this exception throw isn't initial obvious to me (as a novice) what exactly I might be doing wrong. Hoping the community might have some insight into whether or not those 2 libraries are inherently incompatable inside the same process. As far as I can tell I don't even get to the creation of the actual ProtoReflectionDescriptorDatabase construction the error happens while the process is starting up.
Thanks in advance for any advice on those topics.