18

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

However I get the following response

Missing input file.

Any suggestions on what I might be doing wrong ?

2
  • The -cpp_out tag specifies the output directory for generated c source code. Commented Jul 7, 2013 at 20:16
  • so what am I doig wrong ? Commented Jul 7, 2013 at 20:18

2 Answers 2

33

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

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

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

or

protoc addressbook.proto --cpp_out=./
Sign up to request clarification or add additional context in comments.

Comments

5

Since the only answer in this thread didn't lead me to the solution I needed, here it is.

The syntax for calling the protoc.exe is as follows:

protoc --proto_path=<proto_directory> --cpp_out=<output_directory> <proto_file>

Important is that the argument to proto_path is a directory instead the specific .proto-file path. The actual proto files used are appended at the end of the command (<proto_file>).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.