OK, it was me being ignorant :-)

For anyone else who has this same problem:
I came into the help directly at message.h. What I didn't know about was 
the existence of descriptor.h
Once this was included, all was well

#include <google/protobuf/descriptor.h>

On Monday, 29 July 2013 12:25:37 UTC+2, Gary Doherty wrote:
> Hi
> I'm quite new to protobufs. 
> Using VC++ 2010 Express, I can compile and run the Address_Book example 
> and I've created my own protobufs, compiled run and serialised data to and 
> from them. All ok.
> I want to use the abstract Message interface as defined in 
> https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message
> I used the protobuf definition and code snippets provided in message.h but 
> on blue line below:
>   Message* foo = new Foo;
>   const Descriptor* descriptor = foo->GetDescriptor();
>   const FieldDescriptor* text_field = descriptor->FindFieldByName("text");
> the error message: "Error: pointer to incomplete class type not allowed" 
> is shown in the mouse-over for 'descriptor' and the compiler gives error 
> C2027: use of undefined type 'google::protobuf::Descriptor'
> If I comment out that line (and subsequent lines in the example), it 
> compiles and runs ok and I can see the descriptor (but it does contain 
> unknown fields)
> Any help would be welcome.
> Thanks

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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to