Open nikhilkalige opened 2 weeks ago
The .proto.h
codegen does not give transitive declarations.
You have to include each file that you use.
Eg when you do foo.bar()
you have to include the .proto.h
for the type of foo
and the .proto.h
for the type returned by bar()
.
This is opposed to .pb.h
that does transitive inclusions and you can do a single include for a whole dependency tree.
@sbenzaquen That does make sense, but should you not be able compile at-least the generated .pb.cc
files without any change?
I have been unable to compile c++ code generated by passing
--cpp_out=proto_h
to the compiler. I tried compiling just the generatedpb.cc
file and I get the following errors on v24.4.I tried updating it to v26.1, even with that version I get different errors. Is there any documentation or examples on how to get this working.
Thank you
What version of protobuf and what language are you using? Version: 24.4 Language: C++
What operating system (Linux, Windows, ...) and version? Linux
What runtime / compiler are you using (e.g., python version or gcc version) gcc 11.4.0