Closed GoogleCodeExporter closed 9 years ago
Issue resolved via an update to the example on the home page.
Original comment by evan.lap...@gmail.com
on 24 Oct 2011 at 8:19
Hello. I ran into the same problem mentioned under 1, and the example on the
homepage still has the line "bob = pb_read_Person();", which does not work. I
would like to know the correct way of doing it.
I would greatly appreciate it if you would fix the example code and test it.
Not trying to insult you by stating the obvious here, but given the scarce
documentation, it is pretty important that your canonical example actually
works ;-)
Original comment by deni...@gmail.com
on 17 Aug 2012 at 3:25
Sorry to hear you're having trouble with this. The example code does work for
me, so in order to help resolve this it would be helpful to know:
1. The version of matlab you're using
2. The contents of the 'bob' variable after the 'bob = pb_read_Person();' call
(you can determine this by typing 'bob' without a semicolon in the matlab
command window and pressing enter).
Lastly, any patches or suggestions for improving the documentation would be
great.
Original comment by evan.lap...@farsounder.com
on 17 Aug 2012 at 10:02
Hi again, thanks for the response!
I am running Matlab version R2012a (7.14.0.739). I successfully compiled your
person.proto example to the Matlab routines, started Matlab, and added the
utility routines to the path. What happens next is this:
>> bob = pb_read_Person();
Warning: Required field not set while parsing. This is an error.
> In pblib_generic_parse_from_string at 111
In pb_read_Person at 31
Warning: Required field not set while parsing. This is an error.
> In pblib_generic_parse_from_string at 111
In pb_read_Person at 31
This sounds a lot like what happened to the first poster in this thread, who
explained that the code will check if all required fields are set if you don't
supply a buffer. I have not looked into the generated code very hard myself,
but obviously there is a check for the required fields that fails here.
Is there another, safer way to instantiate an empty Person in this example that
will not trigger the error, or possibly some workaround that you know of? I
would be greatly helped. We are using protocol buffers across a number of
different languages. It would be a big setback if we can't get Matlab to work.
Original comment by deni...@gmail.com
on 20 Aug 2012 at 11:49
[deleted comment]
...sorry, forgot to paste the contents of the 'bob' variable:
bob =
has_field: [4 java.util.HashMap]
name: ''
id: 0
email: ''
phone: [0x0 struct]
unknown_fields: []
descriptor_function: @pb_descriptor_Person
Update: It just dawned on me that this is just a warning (the 'This is an
error.' part of the message got me there;) Needs fixing I suppose, but at least
I can continue for now, or so it appears.
Original comment by deni...@gmail.com
on 20 Aug 2012 at 12:20
Original issue reported on code.google.com by
gtoons...@gmail.com
on 13 Oct 2011 at 4:29