Labels: Type-Defect Priority-Medium
New issue 657 by abys...@gmail.com: Unnecessary dependency against protobuf
in third-level targets.
I have C++ generated file, say `a.pb.cc`, and I link it into shared library
`a.so`. This library is also linked against `libprotobuf.so`.
When I do include `a.pb.h` in another file, say `test.cc`, I can't link it
into executable `test` without adding dependency on `libprotobuf.so`:
otherwise, I get undefined symbols errors, like:
char, google::protobuf::MessageLite const&,
The sum-up of dependencies:
1) test (test.cc includes a.pb.h) depends on a.so (a.pb.cc includes a.pb.h)
2) a.so (a.pb.cc includes a.pb.h) depends on libprotobuf.so
3) test (test.cc includes a.pb.h) depends on libprotobuf.so (!)
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
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to email@example.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.