-
Notifications
You must be signed in to change notification settings - Fork 937
Open
Description
陈老师,你好!
碰到个问题,在使用protobuf时,我看了codec.h里封装的代码,我在测试中碰到如下问题:
比如我有个 AutoReq.proto,它属于package montnets;
调用 const google::protobuf::Descriptor* descriptor =
google::protobuf::DescriptorPool::generated_pool()->FindMessageTypeByName("montnets.AuthReq");
后校验 descriptor 为nullptr, 如果我在调用这个的前面加上 static montnets::AuthReq request; 就能正常。难道一定要在项目中先使用到具体的一个protobuf类之后它才能放入DescriptorPool 池中,这个怎么优化!
谢谢! 附带:我使用的是protobuf 3.4.1
Metadata
Metadata
Assignees
Labels
No labels