It looks like you have an enum value named NULL, which conflicts with the NULL macro in C++. I haven't looked into this but it is possible that we added some workaround for this somewhere between 3.6.1 and 3.13.0. There is no reason for your Java and C++ to have the same protobuf version, though, so I would recommend that if your C++ project was already on 3.13.0 and was building successfully, then keep it on 3.13.0 instead of downgrading to 3.6.1. If you could provide more details about the protobuf.has_scalar_value() problem then I could try to see what is going wrong.
On Wed, Sep 2, 2020 at 6:33 AM Test Last <[email protected]> wrote: > Hi All > > I am getting some errors where at a certain amount of data the > protobuf.has_scalar_value() will show false. > But I am sure that there is indeed more data because I can see it in the > response I received from the server. > However the server is a Java implementation of Apache Calcite running > Protobuf V3.6.1. > At first my C++ program was running Protobuf V3.13.0 and I kept on getting > errors when the data exceeds a certain amount of data. I AM NOT however > sure that, that is indeed the case but the current error is very obscure at > this stage. > So then to try and remedy the situation I pulled TAG Protobuf V3.6.1 and I > compiled it. > Ran protoc on them and I got the following error WHICH I didn't receive in > 3.13.0 AND ALSO not on the Java server side running same version. ALSO This > is done on a newly installed Ubuntu server 20 OS. > > protoc -I=. --cpp_out=. ./common.proto > protoc -I=. --cpp_out=. ./request.proto > protoc -I=. --cpp_out=. ./response.proto > g++ -g -fPIC -c common.pb.cc -L/usr/local/lib `pkg-config --cflags --libs > protobuf` -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed -ldl -o > common.o -std=c++14 > In file included from > /usr/include/x86_64-linux-gnu/bits/types/stack_t.h:23, > from /usr/include/signal.h:303, > from /usr/include/x86_64-linux-gnu/sys/param.h:28, > from /usr/local/include/google/protobuf/stubs/port.h:64, > from /usr/local/include/google/protobuf/stubs/common.h:46, > > from common.pb.h:9, > from common.pb.cc:4: > common.pb.h:222:3: error: expected identifier before ‘__null’ > 222 | NULL = 24, > | ^~~~ > common.pb.h:222:3: error: expected ‘}’ before ‘__null’ > > So my question is. How is it possible that Protobufs work on the Java > server but not on my C++ implementation with the same Proto files and same > version compiled for this OS? > Is it a bug in the V3.6.1 ? > > > -- > 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 view this discussion on the web visit > https://groups.google.com/d/msgid/protobuf/4408fbbb-786c-4e03-93ef-7dfcd045a772n%40googlegroups.com > <https://groups.google.com/d/msgid/protobuf/4408fbbb-786c-4e03-93ef-7dfcd045a772n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/CADqAXr6xRDHOcMKqm8beOPY5sJGNa73mO9D4qXxuyFdZEVPcfA%40mail.gmail.com.
