How to deal with multiple .proto files with the same package/message names?

Viewed 20

There are two different .proto files (say foo.proto and bar.proto) for different services where both use the package name internal and both define a ToService message. I need to use both protocols from the same program, but when I try to do that, I get duplicate symbol linker errors; both define internal::ToService::~ToService and other symbols in the internal:: namespace.

I would really, really prefer to not have to modify the .proto files. How do I tell protoc to generate code in a different namespace than internal?

0 Answers
Related