Protocol buffer error during compilation during GOOGLE_PROTOBUF_MIN_PROTOC_VERSION check

I am currently receiving an error message that points me to these lines in the header file created by protoc:

#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #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. #endif 

But my protoc version is the same as the previous version:

 protoc --version libprotoc 2.6.1 

What am I doing wrong?

My protoc version was originally 3.0.0, and then reinstalled it, syncing it to 2.6.1 and following the steps; make distclean,. / configure, make, make install to install the desired version 2.6.1. I needed an old version, as it was installed on our servers.

+5
source share
1 answer

The problem is that the installed headers on your system (in / usr / include / google / protobuf or / usr / local / include / google / protobuf) are taken from a newer version of the protocol buffers than your protoc . You may have both versions installed in different places and using the wrong one.

But my protoc version is the same as the previous version:

Yes, because this code was created by your protoc , and it knows its own version. The code asks the question: "Is my version (2006001) smaller than the minimum version required by the declared headers (GOOGLE_PROTOBUF_MIN_PROTOC_VERSION)?"

+10
source

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


All Articles