抱歉,对protobuf来说很新。复制粘贴一些代码并得到一个没有多大意义的错误。请任何人帮忙。
message person {
required string name = 1;
enum PhoneType {
MOBILE = 0;
HOME = 1;
WORK = 2;
}
message PhoneNumber {
required string number = 1;
optional PhoneType type = 2 [default = HOME];
}
}
我得到的错误是当我运行protoc p2.proto --cpp_out =:
时p2.proto:4:1: Expected "required", "optional", or "repeated".
p2.proto:4:1: Expected type name.
p2.proto:10:1: Expected "required", "optional", or "repeated".
p2.proto:10:1: Expected type name.