Using the --proto_path option

9,573 views
Skip to first unread message

Collin

unread,
Jan 11, 2011, 4:30:15 PM1/11/11
to Protocol Buffers
I am trying to understand how --proto_path works. Let's say in
my .proto file have the following import lines:
import "descriptor.proto";
import "google/protobuf/descriptor.proto";



What would the path be for the option?

I have tried using different path:
protoc --proto_path=/usr/local/include/google/protobuf --
cpp_out=. ....
protoc --proto_path=/usr/local/include --cpp_out=. ....


The only way I have gotten it to work is to copy the descriptor.proto
to the current directory for the first import line above. Or create
sub-directories matching path in the second import line.

Kenton Varda

unread,
Jan 11, 2011, 8:55:44 PM1/11/11
to Collin, Protocol Buffers
On Tue, Jan 11, 2011 at 1:30 PM, Collin <black...@gmail.com> wrote:
I am trying to understand how --proto_path works. Let's say in
my .proto file have the following import lines:
import "descriptor.proto";
import "google/protobuf/descriptor.proto";

Delete the first of these two imports, and then use --proto_path=/usr/local/include.
Reply all
Reply to author
Forward
0 new messages