协议缓冲区中缺少带有 protoc 的输入文件 [英] Missing input file with protoc in protocol buffer

查看:70
本文介绍了协议缓冲区中缺少带有 protoc 的输入文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I currently have a file called addressbook.proto in next to my protoc.exe. I am having difficulty generating the .h and the .cc file. Here is what I am doing

protoc --cpp_out=c:\addressbook.proto

但是我得到以下回复

Missing input file.

对我可能做错的事情有什么建议吗?

Any suggestions on what I might be doing wrong ?

推荐答案

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

The -cpp_out tag specifies the output directory for generated c source code.

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

I would suggest trying (if proto is actually stored under the c: directory c:\addressbook.proto)

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

protoc addressbook.proto --cpp_out=./

这篇关于协议缓冲区中缺少带有 protoc 的输入文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆