Hi Kenton,

I have the following message in my .proto file:

package traceFileMessagesProto;

message RecordHeader {

message  myqueue{
 optional uint32 id = 1;
 optional uint32 Priority = 2;

message  action{
 optional eactiontype    eactiontype_instance = 1;
 optional ereason ereason_instance = 2;
 optional myqueue myqueue_instance = 3;
optional action action_instance =1;

} //end RecordHeader
Thus, "action" is nested message in "RecordHeader" and has "queue"
submessage in it.

I used the protoc compiler -o <desc-file> option to generate the descriptor
set file and loaded it through istream in c++ application, followed by
streaming FileDescriptorSet object with this descriptor set file:

ifstream desc_file("mydescriptor.dsc",ios::in);
FileDescriptorSet f;

However, while parsing through DescriptorPool::BuildFile(f.file(0));
at the line corresponding to the message file line:
=> optional action action_instance =1;

the BuildFile() function exits by giving error:

undefined_symbol "action"

The code returns through the following function in protoc library:
void DescriptorBuilder::AddNotDefinedError(
    const string& element_name,
    const Message& descriptor,
    DescriptorPool::ErrorCollector::ErrorLocation location,
    const string& undefined_symbol) {
  if (possible_undeclared_dependency_ == NULL) {
    AddError(element_name, descriptor, location,
             "\"" + undefined_symbol + "\" is not defined.");

The only possible explanation could be that the message "action" is not
parsed before its instance declaration from my .proto/descriptor_set file.
Probably all nested messages should be parsed on their instance declarations
in a recursive manner in the DescriptorPool::Buildfile() function.
How do I solve the above issue?

Question 2:
Can not I simply load my messages in DescriptorPool through the .proto file
instead of calling the service of protoc compiler to generate a descriptor
file? I have to generate .proto file at runtime and I don't want to call
another exe (protoc.exe) from my application for dependency reasons.

Thanks in advance for any solutions /directions.


You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to