To start with you need to use the qualify with the package as
google.protobuf.DescriptorProto. See the section on Name Resolution:
https://developers.google.com/protocol-buffers/docs/proto#packages

Assuming your paths are set up correctly it should work after that.

On Fri, Sep 28, 2012 at 2:19 AM, Fahad Madani <fsmad...@gmail.com> wrote:
> Hi,
>
> I am trying to compile my .proto file using protoc compiler and generate
> java classes for the same.
> Below is my Job.proto file
>
> import "google/protobuf/descriptor.proto";
>
> option java_package = "com.myfile.test";
> option java_outer_classname = "JobProto";
>
> message Job{
>     required string companyName = 1;
>     required string designation = 2;
>     required int32 salary = 3;
>     required DescriptorProto file_prot = 4;
> }
>
> And my protoc command is
>
> protoc %Input%\Job.proto --java_out=%Output% --descriptor_set_out=job.desc
> --proto_path=%Input% --proto_path=%protobuf_src_folder%
>
> where environment variable definition are:
> Input: Folder in which Job.proto file is present
> Output: Foldedr where my output classes are generated
> protobuf_src_folder: Path till "..\protobuf-2.4.1\src"
>
> when i execute the above command i get
> Job.proto:11:18: "DescriptorProto" is not defined.
>
> I have tried copying the discriptor.proto in the same folder and modifying
> the import statement (still i get the same error). Whatever i have browse i
> just found setting --proto_path properly but in my case the path is proper
> but still i am getting the same error. I have also ensure that my protobuf
> source version and protoc version are same "2.4.1"
>
> Can anyone tell me whats wrong ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/protobuf/-/bC1aYBXjCw4J.
> To post to this group, send email to protobuf@googlegroups.com.
> To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to