Hmm -- I don't have access to VS2008, but the files generated by 2.2.0a protoc for your .proto compile fine for me in gcc. Perhaps there's some additional reserved word in VS2008 e.g. what happens if you rename "Arc" to another name?
And just checking -- have you modified the generated files or included headers in any way? On Thu, Dec 10, 2009 at 9:21 AM, bayWeiss <[email protected]> wrote: > I cant post the whole generated .h file, but below is a snippet where > for some reason the compiler cant identify the Arc class. The > declaration for Arc is definitely above the below c++ snippet, but it > acts as if it cant recognize it. > > ---the errors are from VS2008------------------------------ > > error C4430: missing type specifier - int assumed. Note: C++ does not > support default-int c:\googleprototest\googleprototestcppserver > \person.pb.h 669 GoogleProtoTestCPPServer > error C2143: syntax error : missing ';' before '&' c:\googleprototest > \googleprototestcppserver\person.pb.h 669 > error C2838: 'Arc' : illegal qualified name in member declaration c: > \googleprototest\googleprototestcppserver\person.pb.h 669 > error C4430: missing type specifier - int assumed. Note: C++ does not > support default-int c:\googleprototest\googleprototestcppserver > \person.pb.h 669 > > -----here is the generated header snippet from 2.2.0a protoc, within > the Entity class declaration-------- > > // optional .Square square = 3; > inline bool has_square() const; > inline void clear_square(); > static const int kSquareFieldNumber = 3; > inline const ::Square& square() const; > inline ::Square* mutable_square(); > > // optional .Arc arc = 4; > inline bool has_arc() const; > inline void clear_arc(); > static const int kArcFieldNumber = 4; > inline const ::Arc& arc() const; // <- the > problem is here, line 669 > inline ::Arc* mutable_arc(); // and > here as well > > -------here is the .proto file--------- > > message Point > { > required double X = 1; > required double Y = 2; > } > > message Circle > { > required Point point1 = 1; > required Point point2 = 2; > required Point point3 = 3; > required Point point4 = 4; > } > > message Square > { > repeated Point pointList = 1; > } > > message Arc > { > required Point center = 1; > required double startAngle = 2; > required double endAngle = 3; > } > > message Parameter > { > required double somethingHere = 1; > } > > message Entity > { > enum Type { CIRCLE = 1; SQUARE = 2; ARC = 3; } > > // Identifies which entity it is. > required Type type = 1; > > optional Circle circle = 2; > optional Square square = 3; > optional Arc arc = 4; > } > > message Job > { > repeated Entity entity = 1; > } > > message Initialize > { > } > > message Start > { > } > > message MainMessage > { > enum Type { NEW_JOB = 1; INITIALIZE = 2; START = 3;} > > // Identifies which field is filled in. > required Type type = 1; > > // One of the following will be filled in. > optional Job job = 2; > optional Initialize initialize = 3; > optional Start start = 4; > } > > > > -- > > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<protobuf%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/protobuf?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
