Going to leave this here in case anyone else hits this issue.
Its:
> import "google/protobuf/*a*ny.proto";
Not
> import "google/protobuf/*A*ny.proto";
The protoc C++ will generate invalid externs, aka
> descriptor_table_google_2fprotobuf_2f*a*ny_2eproto !=
descriptor_table_google_2fprotobuf_2f*A*ny_2eproto
On Sunday, April 10, 2022 at 12:45:30 PM UTC-5 gedden wrote:
> I have a proto file which uses the "Any" type.
>
>
> *Client.proto*
> import "google/protobuf/Any.proto";
> ...
> message ClientConnectivityMessage
> {
> ClientToServerConnectivityMessageSubtype Subtype = 1;
> google.protobuf.Any Request = 2;
> }
>
>
> I have generated functional (production) protocols for java and C# from
> this way back 3.0.0-beta. I am updating my programs to use Java / C++ and
> am switching to *3.20.0*. I can generate the **.pb.cc *&* *.pb.h* files
> just fine. The generated *Client.pb.cc <http://Client.pb.cc>* file has a
> descriptor in in that references the google protof Any (as expected)
> > *descriptor_table_google_2fprotobuf_2fAny_2eproto*
>
> *When attempting to compile with this file, I get the error:*
>
> *> error C2039: 'descriptor_table_google_2fprotobuf_2fAny_2eproto': is
> not a member of '`global
> namespace''> 'descriptor_table_google_2fprotobuf_2fAny_2eproto': undeclared
> identifier*
>
> To me, this implies that the descriptor itself does not exist. However I
> do see this line in *any.bp.h*
> > PROTOBUF_EXPORT extern const
> ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable
> descriptor_table_google_2fprotobuf_2fany_2eproto;
>
> Which implies to me that it does in fact exist, but is somehow 'internal'
> and 'extern'?
> * Its in a header that is included
> * files generated from .proto definitions that do not include references
> to 'Any' seem to work & compile just fine.
> * I am generating these .cc files with the same version i'm attempting to
> compile against. (3.20.0)
>
> Any appears to still be a supported type, what am I missing here?
>
> Any help would be greatly appreciated.
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/protobuf/a9173e51-6a73-448b-ae79-fa7eff1053afn%40googlegroups.com.