Hi,

I've found posts on dealing with .proto files in different directories, 
using packages, proto_path and canonical names, but I still can't figure 
out how to compile a basic protobuf file layout with a.proto and 
sub/b.proto that includes a.proto.

Perhaps the sticking point is I want to use a "*import ../<file.proto>*" 
format import statement so the Eclipse protobuf editor can resolve 
<file.proto>.  There is no proto_path setting in Eclipse so I need to use 
relative file names.

File ./a.proto:

message A {
        required int32 a = 1;
}



File sub/b.proto:

import "../a.proto";
message B {
        required int32 b = 1;
        required A a = 2;
}


I have not found an invocation or protoc (2.5) that can compile this.  For 
example:

In directory ./:

$ protoc sub/b.proto --java_out=/tmp
../a.proto: File not found.
sub/b.proto: Import "../a.proto" was not found or had errors.
sub/b.proto:4:18: "A" is not defined.


$ protoc --proto_path=. sub/b.proto --java_out=/tmp
../a.proto: File not found.
sub/b.proto: Import "../a.proto" was not found or had errors.
sub/b.proto:4:18: "A" is not defined.



In directory ./sub:

$ protoc b.proto --java_out=/tmp
../a.proto: File not found.
b.proto: Import "../a.proto" was not found or had errors.
b.proto:4:18: "A" is not defined.

 

$ protoc --proto_path=. --proto_path=../ b.proto --java_out=/tmp
../a.proto: File not found.
b.proto: Import "../a.proto" was not found or had errors.
b.proto:4:18: "A" is not defined.



Any tips are greatly appreciated!

Steve 

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to