[已解决] No syntax specified for the proto file : xxx.proto
在使用protobuf生成相应类文件如java文件的时候需要指定proto的版本,
如:
syntax = "proto2"; package my_package; message Person { required string name = 1; required int32 id = 2; optional string email = 3; enum PhoneType { MOBILE = 0; HOME = 1; WORK = 2; } message PhoneNumber { required string number = 1; optional PhoneType type = 2 [default = HOME]; } repeated PhoneNumber phone = 4; }
这是proto2的描述文件,如果使用proto3的话需要指定:syntax = "proto3";
原文来自:http://www.cnblogs.com/gifisan/p/5976208.html
轻量级 Java NIO 工具包:https://github.com/generallycloud/baseio