c++ - Protocol Buffer 中缺少带有协议(protocol)的输入文件

标签 c++ protocol-buffers

目前我的 protoc.exe 旁边有一个名为 addressbook.proto 的文件。我在生成 .h 和 .cc 文件时遇到困难。这是我正在做的

protoc --cpp_out=c:\addressbook.proto

但是我得到以下响应

Missing input file.

对我可能做错了什么有什么建议吗?

最佳答案

-cpp_out 标签指定生成的 c 源代码的输出目录。

我会建议尝试(如果 proto 实际上存储在 c: 目录下 c:\addressbook.proto)

protoc c:\addressbook.proto --cpp_out=./

protoc addressbook.proto --cpp_out=./

关于c++ - Protocol Buffer 中缺少带有协议(protocol)的输入文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17515840/

相关文章:

c++ - 如何在 C++ 中模拟堆栈帧?

c++ - 一类嵌套类不能作为模板函数typename

给定的 C++ Windows API GetSecurityInfo 无效句柄

java - Java Protocol Buffers 能否在重复字段的列表 getter 上返回 null?

c++ - 如何以简单的方式声明可变参数模板类的类型

c++ - 读取文件后如何构建不同对象的 vector

Dart protobuf : what version of protoc should I download?

request - 根据我的请求设置日期值时,Google Protocol Buffers : c. toArray 不是一个函数

c++ - 如何在 linux 上通过 cmake 链接 google protobuf 库?

go - 如何将 protoc-gen-go gzipped FileDescriptorProto 显示为纯文本?