Protoc v3. 15 and v3.17 creates undefined variables in pb.cc files

209 views
Skip to first unread message

Lev Olshvang

unread,
Jul 5, 2021, 7:58:20 AM7/5/21
to Protocol Buffers
Hello team,
We are new to protobuf development. We stuck with the following problem :
protoc compiler creates an internal descriptor table in pb.cc fiie. 

static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_resource_5flocator_2eproto_deps[3] = {
  &::descriptor_table_udpa_2fannotations_2fstatus_2eproto,
  &::descriptor_table_validate_2fvalidate_2eproto,
  &::descriptor_table_xds_2fcore_2fv3_2fcontext_5fparams_2eproto,
};
 some similar descriptors are defined in protobuf includes, like following :
protobuf-3.17.3/src/google/protobuf/any.pb.h:PROTOBUF_EXPORT extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fany_2eproto;

But others are not present in protobuf includes and we got compilation error:
descriptor_table_udpa_2fannotations_2fstatus_2eproto’ has not been declared

And more ....
udpa/xds/core/v3/resource_locator.pb.cc:111:6: error: ‘::descriptor_table_udpa_2fannotations_2fstatus_2eproto’ has not been declared
   &::descriptor_table_udpa_2fannotations_2fstatus_2eproto,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
udpa/xds/core/v3/resource_locator.pb.cc:111:6: note: suggested alternative: ‘descriptor_table_google_2fprotobuf_2fduration_2eproto’
   &::descriptor_table_udpa_2fannotations_2fstatus_2eproto,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      descriptor_table_google_2fprotobuf_2fduration_2eproto
udpa/xds/core/v3/resource_locator.pb.cc:112:6: error: ‘::descriptor_table_validate_2fvalidate_2eproto’ has not been declared
   &::descriptor_table_validate_2fvalidate_2eproto,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
udpa/xds/core/v3/resource_locator.pb.cc:112:6: note: suggested alternative: ‘descriptor_table_validate_2eproto’
   &::descriptor_table_validate_2fvalidate_2eproto,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      descriptor_table_validate_2eproto
udpa/xds/core/v3/resource_locator.pb.cc:113:6: error: ‘::descriptor_table_xds_2fcore_2fv3_2fcontext_5fparams_2eproto’ has not been declared
   &::descriptor_table_xds_2fcore_2fv3_2fcontext_5fparams_2eproto,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
udpa/xds/core/v3/resource_locator.pb.cc:113:6: note: suggested alternative: ‘descriptor_table_context_5fparams_2eproto’
   &::descriptor_table_xds_2fcore_2fv3_2fcontext_5fparams_2eproto,


PLEASE HELP HELP HELP HELP !!!!
Regards



Ivan Pizhenko

unread,
Jul 23, 2021, 2:43:12 PM7/23/21
to Protocol Buffers
Hi, could you solve this issue? I am facing simuilar one and looking for resolution.

понеділок, 5 липня 2021 р. о 14:58:20 UTC+3 lev.ol...@imperva.com пише:

Adam Cozzette

unread,
Jul 23, 2021, 2:56:23 PM7/23/21
to Ivan Pizhenko, Protocol Buffers
The only things I can think of that would cause this sort of error would be things like:
- Mixing generated code from multiple protoc versions
- Rebuilding the generated code for one .proto file but not other closely-related .proto files
If you rebuild all the generated code using a single consistent protoc version then I would expect the problem to go away.

--
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 protobuf+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/c3dff170-b622-4c2c-b979-ab20ea6ee5fan%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages