[protobuf] Re: Difference between protobuf implementations
"import" looks for the file in the proto_path, not in the same directory as the importing file. On Wed, Nov 11, 2009 at 6:34 AM, rahul prasad wrote: > Hi, > > I am getting errors when trying to "protoc" the .proto file i created. I am > trying to import message definition from a different file present in the > same directory as the one being compiled with this at the top - > > package testpackage; > import "TestimportProto.proto"; > > but I still get the following error when compiling - > > rahul$ protoc --proto_path="/Users/rahul/NetBeansProjects/Testproj" > --java_out > "/Users/rahul/NetBeansProjects/AndMarket/build/generated-sources/protobuf-java" > "/Users/rahul/NetBeansProjects/Testproj/src/java/Test.proto" > TestimportProto.proto: File not found. > src/java/Test.proto: Import "TestimportProto.proto" was not found or had > errors. > src/java/Test.proto:19:12: "TestimportInfo" is not defined. > src/java/Test.proto:30:12: "Testimportstate" is not defined. > > Anyone can help? Greatly appreciate it. > > Regards, > Rahul > > > On Tue, Nov 10, 2009 at 7:16 PM, Kenton Varda wrote: > >> Yes, the tag numbers have to be the same. >> >> If you have code that was generated from the original .proto file, look >> inside it for comments that look like proto field definitions -- they should >> include the tag number. Otherwise you're out of luck. >> >> On Tue, Nov 10, 2009 at 4:00 PM, rahul prasad wrote: >> >>> I am in a situation, where the .proto files are not present for the >>> Protocol Buffers used in the application I am working on. Since the .proto >>> files need to be created, I was wondering if the following yellow >>> highlighted numbers should correspond to the same fields they stood for in >>> the actual .proto files which were used to generate the classes? >>> >>> For example, - >>> >>> old proto file: >>> package protos; >>> message Person { >>> required string name = 1; >>> optional string age = 2; >>> } >>> >>> new proto file: >>> package protos; >>> message Person { >>> required string name = 2; >>> optional string age = 1; >>> } >>> >>> will this throw error when trying to retrieve data?, so what would your >>> suggestion be in creating such a proto file when the original is not >>> present. >>> >>> Regards, >>> Rahul >>> >>> >>> >>> >> > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[protobuf] Re: Difference between protobuf implementations
Hi, I am getting errors when trying to "protoc" the .proto file i created. I am trying to import message definition from a different file present in the same directory as the one being compiled with this at the top - package testpackage; import "TestimportProto.proto"; but I still get the following error when compiling - rahul$ protoc --proto_path="/Users/rahul/NetBeansProjects/Testproj" --java_out "/Users/rahul/NetBeansProjects/AndMarket/build/generated-sources/protobuf-java" "/Users/rahul/NetBeansProjects/Testproj/src/java/Test.proto" TestimportProto.proto: File not found. src/java/Test.proto: Import "TestimportProto.proto" was not found or had errors. src/java/Test.proto:19:12: "TestimportInfo" is not defined. src/java/Test.proto:30:12: "Testimportstate" is not defined. Anyone can help? Greatly appreciate it. Regards, Rahul On Tue, Nov 10, 2009 at 7:16 PM, Kenton Varda wrote: > Yes, the tag numbers have to be the same. > > If you have code that was generated from the original .proto file, look > inside it for comments that look like proto field definitions -- they should > include the tag number. Otherwise you're out of luck. > > On Tue, Nov 10, 2009 at 4:00 PM, rahul prasad wrote: > >> I am in a situation, where the .proto files are not present for the >> Protocol Buffers used in the application I am working on. Since the .proto >> files need to be created, I was wondering if the following yellow >> highlighted numbers should correspond to the same fields they stood for in >> the actual .proto files which were used to generate the classes? >> >> For example, - >> >> old proto file: >> package protos; >> message Person { >> required string name = 1; >> optional string age = 2; >> } >> >> new proto file: >> package protos; >> message Person { >> required string name = 2; >> optional string age = 1; >> } >> >> will this throw error when trying to retrieve data?, so what would your >> suggestion be in creating such a proto file when the original is not >> present. >> >> Regards, >> Rahul >> >> >> >> > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[protobuf] Re: Difference between protobuf implementations
Yes, the tag numbers have to be the same. If you have code that was generated from the original .proto file, look inside it for comments that look like proto field definitions -- they should include the tag number. Otherwise you're out of luck. On Tue, Nov 10, 2009 at 4:00 PM, rahul prasad wrote: > I am in a situation, where the .proto files are not present for the > Protocol Buffers used in the application I am working on. Since the .proto > files need to be created, I was wondering if the following yellow > highlighted numbers should correspond to the same fields they stood for in > the actual .proto files which were used to generate the classes? > > For example, - > > old proto file: > package protos; > message Person { > required string name = 1; > optional string age = 2; > } > > new proto file: > package protos; > message Person { > required string name = 2; > optional string age = 1; > } > > will this throw error when trying to retrieve data?, so what would your > suggestion be in creating such a proto file when the original is not > present. > > Regards, > Rahul > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[protobuf] Re: Difference between protobuf implementations
I am in a situation, where the .proto files are not present for the Protocol Buffers used in the application I am working on. Since the .proto files need to be created, I was wondering if the following yellow highlighted numbers should correspond to the same fields they stood for in the actual .proto files which were used to generate the classes? For example, - old proto file: package protos; message Person { required string name = 1; optional string age = 2; } new proto file: package protos; message Person { required string name = 2; optional string age = 1; } will this throw error when trying to retrieve data?, so what would your suggestion be in creating such a proto file when the original is not present. Regards, Rahul --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[protobuf] Re: Difference between protobuf implementations
You'd have to ask the Android people, as they are the owners of this alternate implementation. IIRC, they have not released the code generator program to go with it, so you probably won't be able to use it. The official protobuf implementation in "lite mode" should work great on Android -- this is exactly the use case lite-mode was created for. Add the following to your .proto file in order to use lite mode: option optimize_for = LITE_RUNTIME; So I'd recommend using the official implementation, but again I know almost nothing about Android's implementation so it's hard for me to make an informed recommendation. On Tue, Nov 10, 2009 at 1:36 PM, rahul prasad wrote: > So, If I am developing for Android, should I use this protobuf library > instead of the standard implementation present at com.google.protobuf? Will > I encounter any problems mid way due to this switch? Any feedback would be > greatly appreciated. > > Regards, > Rahul > > > On Tue, Nov 10, 2009 at 3:56 PM, Henner Zeller wrote: > >> Seems to be part of Android >> >> http://www.google.com/codesearch?q=com.google.common.io.protocol.ProtoBuf >> >> On Tue, Nov 10, 2009 at 11:36, Kenton Varda wrote: >> > On Tue, Nov 10, 2009 at 7:28 AM, rahul prasad >> wrote: >> >> >> >> Hi, >> >> May i ask whats the difference between these two protobuf >> implementations? >> >> com.google.common.io.protocol.ProtoBuf.java >> > >> > I've never heard of this. Where does it come from? >> > >> >> >> >> com.google.protobuf package classes >> > >> > This is the official implementation. >> > >> > >> > >> > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[protobuf] Re: Difference between protobuf implementations
So, If I am developing for Android, should I use this protobuf library instead of the standard implementation present at com.google.protobuf? Will I encounter any problems mid way due to this switch? Any feedback would be greatly appreciated. Regards, Rahul On Tue, Nov 10, 2009 at 3:56 PM, Henner Zeller wrote: > Seems to be part of Android > http://www.google.com/codesearch?q=com.google.common.io.protocol.ProtoBuf > > On Tue, Nov 10, 2009 at 11:36, Kenton Varda wrote: > > On Tue, Nov 10, 2009 at 7:28 AM, rahul prasad wrote: > >> > >> Hi, > >> May i ask whats the difference between these two protobuf > implementations? > >> com.google.common.io.protocol.ProtoBuf.java > > > > I've never heard of this. Where does it come from? > > > >> > >> com.google.protobuf package classes > > > > This is the official implementation. > > > > > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[protobuf] Re: Difference between protobuf implementations
On Tue, Nov 10, 2009 at 7:28 AM, rahul prasad wrote: > Hi, > > May i ask whats the difference between these two protobuf implementations? > > com.google.common.io.protocol.ProtoBuf.java > I've never heard of this. Where does it come from? > com.google.protobuf package classes > This is the official implementation. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---