【问题标题】:Proto file is not being recognised in command line?命令行中无法识别原始文件?
【发布时间】:2014-08-05 10:54:34
【问题描述】:

做 Google 的 Protocol Buffers 教程:https://developers.google.com/protocol-buffers/docs/javatutorial

尝试使用以下方法将其编译成 java 文件:

protoc -I=/home/Eggy/Desktop/Test/ --java_out=/home/Eggy/Desktop/Test/addressbook.proto

错误是:Missing input file

由于某种原因,文件夹中的文件无法识别。如果我按 Tab,文件不会显示在 cmd 中。

这样做:Missing input file with protoc in protocol buffer 这样做是https://groups.google.com/forum/#!topic/protobuf/y2mxdn1vKGY

提出一个不同的错误:

File does not reside within any path specified using --proto_path (or -I). You must specify a --proto_path which encompasses this file.  Note that the proto_path must be an exact prefix of the .proto file names -- protoc is too dumb to figure out when two paths (e.g. absolute and relative) are equivalent (it's harder than you think).

如果这对 Sublime Text 有帮助,我还将文件创建为文本文件并将其保存为 .proto。

【问题讨论】:

    标签: protocols protocol-buffers


    【解决方案1】:

    你的命令有点不对劲。 --java_out参数需要指定destination文件夹,而不是输入文件,然后在列出输入文件之前需要一个空格。

    【讨论】:

    • 谢谢,刚想通--java_out需要指定目标目录和源目录!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-27
    • 2017-07-20
    • 2015-07-03
    • 1970-01-01
    • 2021-08-21
    • 2015-06-29
    相关资源
    最近更新 更多