[protobuf] How to use a different protoc version?

2018-04-26 Thread elmer
Hi there,

When I want use the gRPC and make the C++ files, I got the following error:

error: This file was generated by an older version of protoc which is
error: incompatible with your Protocol Buffer headers. Please
error: regenerate this file with a newer version of protoc.

It seems that I have installed different versions in my system (macOS). I 
checked my protoc version using the command "protoc --version", I got 

libprotoc 3.2.0

Then, I try to upgrade my protoc using the "brew upgrade protobuf", I got 

protobuf 3.5.1_1 already installed

So I also noticed the version 3.5.1 protoc is in 
/usr/local/opt/protobuf/share/doc/protobuf 
. And in /usr/local/opt there is a protobuf folder and a protobuf@3.5 
folder. So I think the error I got when I make the C++ file is caused 
because the 3.5.1 version of protoc is needed but the 3.2.0 version is used.

Am I right? If yes, how can I switch from 3.2.0 to the 3.5.1 version?

Thanks!

-- 
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 https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Default value not accessible in proto3

2018-04-26 Thread 'Feng Xiao' via Protocol Buffers
On Thu, Apr 26, 2018 at 2:12 AM love sidhu  wrote:

> Hi,
>
> This is how my response message is defined in proto file.
>
> message Response{
>  bool isOk = 1;
> }
>
>
> When I set this bool value in gRPC server to false, I'm not receiving it
> on client side
>
If you receive an empty Response message, it means the value of the isOk
field is the default which is false. Why do you care to send it over the
wire?


> but If I set this bool value to true I receive it on client side.
>
> I read this link:
> https://stackoverflow.com/questions/41089035/protobuf-default-values
> and saw that default values are not sent on wire and in case of boolean
> variables, False is default value. I don't know how true it is?
>
>
> Is there some general proper way of how to handle this for all types of
> variables(int32, bool etc.)
>

> Thanks,
> Lovepreet
>
> --
> 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 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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Default value not accessible in proto3

2018-04-26 Thread love sidhu
Hi,

This is how my response message is defined in proto file.

message Response{
 bool isOk = 1;
}


When I set this bool value in gRPC server to false, I'm not receiving it on 
client side
but If I set this bool value to true I receive it on client side. 

I read this link: 
https://stackoverflow.com/questions/41089035/protobuf-default-values 
and saw that default values are not sent on wire and in case of boolean 
variables, False is default value. I don't know how true it is?


Is there some general proper way of how to handle this for all types of 
variables(int32, bool etc.)

Thanks,
Lovepreet 

-- 
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 https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.