Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 657 by Unnecessary dependency against protobuf in third-level targets.

I have C++ generated file, say ``, and I link it into shared library ``. This library is also linked against ``.

When I do include `a.pb.h` in another file, say ``, I can't link it into executable `test` without adding dependency on ``: otherwise, I get undefined symbols errors, like:

"google::protobuf::internal::ExtensionSet::ReleaseMessage(int, google::protobuf::MessageLite const&)" "google::protobuf::internal::ExtensionSet::MutableMessage(int, unsigned char, google::protobuf::MessageLite const&, google::protobuf::FieldDescriptor const*)"

The sum-up of dependencies:

1) test ( includes a.pb.h) depends on ( includes a.pb.h)
2) ( includes a.pb.h) depends on
3) test ( includes a.pb.h) depends on (!)

The possible reason is that I don't know enough about the linking.
The other possible reason is a design flaw in generated files - I don't see any particular reason to link against protobuf every target that already links against generated protobuf files or just includes some .pb.h

You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:

You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
For more options, visit

Reply via email to