Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_***_2eproto #7439

Closed
KaimingGao opened this issue Apr 29, 2020 · 1 comment

Comments

@KaimingGao
Copy link

KaimingGao commented Apr 29, 2020

version : 3.8.0

compile command:
protoc --cpp_out=./ google/protobuf/descriptor.proto -Igoogle/protobuf

then I got descriptor.pb.h. Howerver, this pb.h is different with the original google/protobuf/descriptor.pb.h.

e.g. I got:

extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_descriptor_2eproto;

in my file.

while in the original file, it is:

extern PROTOBUF_EXPORT const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2fprotobuf_2fdescriptor_2eproto;

so, how to compile the descriptor.proto to get the right pb.h ?

by the way, I got a similar issue with

descriptor_table_proto_2fcommon_2eproto #6179 #6179

@haberman
Copy link
Member

haberman commented May 4, 2020

The compiler output is sensitive to filename of the input.

So compiling google/protobuf/descriptor.proto will give different output than compiling just descriptor.proto, even if the file contents are identical.

So if you want to get the same output as the original, run:

protoc --cpp_out=. google/protobuf/descriptor.proto

(ie omit the -I).

@haberman haberman closed this as completed May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants