diff --git a/compiler/src/java_plugin/cpp/java_generator.cpp b/compiler/src/java_plugin/cpp/java_generator.cpp index 6882940378f..3bb56ae12ee 100644 --- a/compiler/src/java_plugin/cpp/java_generator.cpp +++ b/compiler/src/java_plugin/cpp/java_generator.cpp @@ -22,11 +22,18 @@ #include #include #include -#include #include #include #include #include +#include + +// Protobuf 3.21 changed the name of this file. +#if GOOGLE_PROTOBUF_VERSION >= 3021000 + #include +#else + #include +#endif // Stringify helpers used solely to cast GRPC_VERSION #ifndef STR