Gents, thanks a lot for your participation! Problem solved.

2016-09-29 22:42 GMT+03:00 Adam Cozzette <[email protected]>:

> Hi Stanislav, I believe the reason for this is that for serialization we
> verify that required fields are set using the GOOGLE_DCHECK macro (see
> here
> <https://github.com/google/protobuf/blob/3d598eeceef7b1162cbbf3024db2939027a3d08a/src/google/protobuf/message_lite.cc#L235>
> for example). That macro performs the checks only for debug builds, or
> specifically only if NDEBUG is unset. By default you'll get an optimized
> build without those debug checks. I assume that the Ubuntu package was
> built without NDEBUG and so it includes those checks. However, you should
> find that the existence of required fields is always checked during parsing.
>
> On Thu, Sep 29, 2016 at 6:54 AM, Stanislav Eismont <
> [email protected]> wrote:
>
>> Hello!
>>
>> I faced with the next problem. I download https://github.com/go
>> ogle/protobuf/releases/tag/v3.1.0 protobuf source files for c++ and
>> build it according to src/README.md, namely:
>>
>>     $ ./configure
>>     $ make
>>     $ make check
>>     $ sudo make install
>>     $ sudo ldconfig
>>
>> After that my app works(in syntax = "proto2";) fine except one thing:
>> "required" keyword lost its meaning.
>>
>> I have next .proto schema:
>>
>> message Msg {
>>     required int32 foo = 1;
>>     optional int32 bar = 2;
>> }
>>
>> When I try serialize data where "foo" field is absent, I do NOT recieve
>> any error message.
>> But when I link my app with standard ubuntu 14.04 package:
>> libprotobuf-dev=2.5.0-9ubuntu1, I get next error message: "Can.t
>> serialize message of type .Msg. because it is missing required fields foo".
>>
>> Note. I also build with https://github.com/google
>> /protobuf/releases/tag/v2.5.0 sources and the problem still exist.
>>
>> Can anyone help me? Thanks in advance!
>>
>> --
>> 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 [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/protobuf.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to