cmake - protoc v2.6.1 是否应该产生“预期的“必需”、“可选”或“重复”。
问题描述
使用 Ubuntu 16.04 和 CMake,我正在尝试从 protobuf 文件创建一个共享库。CMakes protobuf_generate_cpp 正在生成 PROTO_SRCS 和 PROTO_HDRS。
我的系统上没有任何 google/protobuf/*.proto 文件,所以我下载了 3.6.1 并将它们移动到 /usr/local/include 中。我知道我使用的是 proto2,而 protoc 是版本 2,3.6.1 中的一些 *.proto 文件是 proto3,但是下面的文件(我正在使用的文件是 syntax="proto2"),所以我认为这应该没问题。
但是,我遇到了以下错误。
$ protoc --version
libprotoc 2.6.1
[ 2%] Running C++ protocol buffer compiler on models.proto
google/protobuf/descriptor.proto:439:3: Expected "required", "optional", or "repeated".
google/protobuf/descriptor.proto:439:12: Expected field name.
google/protobuf/descriptor.proto:497:3: Expected "required", "optional", or "repeated".
google/protobuf/descriptor.proto:497:12: Expected field name.
google/protobuf/descriptor.proto:498:3: Expected "required", "optional", or "repeated".
google/protobuf/descriptor.proto:498:12: Expected field name.
google/protobuf/descriptor.proto:597:3: Expected "required", "optional", or "repeated".
google/protobuf/descriptor.proto:597:12: Expected field name.
google/protobuf/descriptor.proto:620:3: Expected "required", "optional", or "repeated".
google/protobuf/descriptor.proto:620:12: Expected field name.
edk/edk_extensions.proto: Import "google/protobuf/descriptor.proto" was not found or had errors.
edk/edk_extensions.proto:15:8: ".google.protobuf.FieldOptions" is not defined.
edk/edk_extensions.proto:20:8: ".google.protobuf.MessageOptions" is not defined.
models.proto: Import "edk/edk_extensions.proto" was not found or had errors.
有人有想法吗?
解决方案
推荐阅读
- css - 确保在 Google pagespeed 洞察报告中未解决 webfont 加载期间文本保持可见
- inner-join - 使用 FOR ALL ENTRIES 连接各种表
- drupal - 如何更改临时 URL - RHEL 和 Drupal 7
- java - 如何使用 danielwegener Kafka appender 在 Kafka 消息中自定义 ZonedDateatime
- javascript - 使用离子(角度)。无法访问在显示屏/屏幕内有按钮的移动设备的硬件后退按钮
- swift - 如何使用以下示例修改gridView
- ios - 在 IOS 中使用 MucSub 获取 MUC 消息历史记录
- python - 使用 python 和 oracle db 在文件中获取、分离和写入相应数据的最快方法
- c++ - 堆栈变量的地址不断变化
- string - 在 kdb+ 中设置带有整数变量和字符串的保存路径的问题