Comment #2 on issue 527 by C++: Descriptor is set to null when loading more than one file.

fstream output(charPath, ios::out | ios::trunc | ios::binary);
if (!reportHeader.SerializeToOstream(&output))
        cerr << "Failed to write protocol buffer." << endl;
        return -1;

fstream in(inPath, ios::in | ios::binary);
if (!deserializedReportHeader.ParseFromIstream(&in))
        cerr << "Failed to parse proto." << endl;

And I get the descriptor using
const Descriptor* descriptor = pMessage->GetDescriptor();
int a = descriptor->field_count();

Does that help?

You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:

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 post to this group, send email to
Visit this group at
For more options, visit

Reply via email to