Protocol Buffer Protocol Error When Trying to Make Mosh Source Code

I am trying to install Mosh (mobile shell) on the following system:

[ ptedder@ukch-dev-lndt03 mosh-1.2.4]$ cat /etc/*-release CentOS release 5.3 (Final) 

It configures normally, however, when I try to make Mosh 1.2.4 (or 1.2.0), I get the following error:

 make all-recursive make[1]: Entering directory `/home/ptedder/bin/mosh-1.2.4' Making all in src make[2]: Entering directory `/home/ptedder/bin/mosh-1.2.4/src' Making all in protobufs make[3]: Entering directory `/home/ptedder/bin/mosh-1.2.4/src/protobufs' make all-am make[4]: Entering directory `/home/ptedder/bin/mosh-1.2.4/src/protobufs' CXX userinput.pb.o In file included from userinput.pb.cc:5: userinput.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is userinput.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update userinput.pb.h:14:2: error: #error your headers. make[4]: *** [userinput.pb.o] Error 1 make[4]: Leaving directory `/home/ptedder/bin/mosh-1.2.4/src/protobufs' make[3]: *** [all] Error 2 make[3]: Leaving directory `/home/ptedder/bin/mosh-1.2.4/src/protobufs' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/ptedder/bin/mosh-1.2.4/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/ptedder/bin/mosh-1.2.4' make: *** [all] Error 2 

This was with protocol buffers version 2.4.1 (suggested that it can be hardcoded in mosh here #import <string> in ios? Protobuf C ++ in ios ), but I also tried using protocol buffers version 2.3.0 and 2.5 .0, and they all give the following error:

 "This file was generated by a newer version of protoc which is userinput.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update userinput.pb.h:14:2: error: #error your headers." 

any ideas?

+6
source share
2 answers

Two years after this question was asked, I still could not find a good solution. I had the same problem, and in the end it was fixed after some kind of detective work. The problem was this: I had the latest protobuf from git repo, https://github.com/google/protobuf . When I tried to create my project, it threw the error shown in qmp answer,

 #if GOOGLE_PROTOBUF_VERSION < 2004000 #error This file was generated by a newer version of protoc which is... 

I was creating code that someone else wrote, and they did not specify a version in their .proto file. The default value is syntax = "proto2"; I added syntax = "proto3"; into the .proto file immediately before the package declaration and deleted all instances of the optional and required keywords, since they are not part of version 3 syntax. Then I restored protobuf from the command line.

 prompt@ubuntu $ protoc --cpp_out=. project.proto 

This updated all files created by the duct to version 3, which solved the problem.

+4
source

If you look at userinput.pb.h, you will notice that it is reading

 #if GOOGLE_PROTOBUF_VERSION < 2004000 #error This file was generated by a newer version of protoc which is 

So protobuf-2.4.1 is enough for mosh-1.2.4. If you still get the error, then a parasitic installation of protobuf may occur, probably something in /usr/local .

0
source

Source: https://habr.com/ru/post/948936/


All Articles