I generated from .proto files *.pb.h and *.pb.cc files using protoc
.
The problem is that i can't export the dll to use it, so I regenrated these files using:
.\protoc.exe --proto_path=.\Proto\ --cpp_out=dllexport_decl=MY_EXP:.\generated .\ABS.proto
Thanks to this, I generated the code with MY_EXP in all the right places, but I couldn't force the generated .pb.h to #include a header which defines MY_EXP
.
However, the generated code contains field:@@protoc_insertion_point(includes)
which means that I probably could add an other includes, but I couldn't understand how I could autogenerate these missing includes in my code.
Thanks.
Asked
Active
Viewed 1,663 times
1

Kais
- 99
- 12
-
I came across this question while struggling with a very similar problem myself. I posted an answer to a similar question here which explains how to create a plugin to leverage the insertion points: https://stackoverflow.com/questions/50806894/how-can-i-add-my-own-code-to-java-generated-classes-from-proto-file/58044855#58044855 – bgomberg Sep 21 '19 at 23:27