2
votes

I could not compile with protobuf on ubuntu. Here is the error:

error: #error This file was generated by a newer version of protoc which is #error This file was generated by a newer version of protoc which is ^ build/x86_64/gen/rtbkit/plugins/exchange/realtime-bidding.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update #error incompatible with your Protocol Buffer headers. Please update ^ build/x86_64/gen/rtbkit/plugins/exchange/realtime-bidding.pb.h:14:2: error: #error your headers. #error your headers. ^ In file included from build/x86_64/gen/rtbkit/plugins/exchange/realtime- bidding.pb.cc:5:0: build/x86_64/gen/rtbkit/plugins/exchange/realtime-bidding.pb.h:26:55: fatal error: google/protobuf/generated_enum_reflection.h: No such file or directory #include ^

I removed it, it still shows protobuf 2.5

1

1 Answers

1
votes

This is a common problem with protobuf. You need to check carefully which protoc you are using, and which headers your are using, this is especially true if you have 2 versions installed! In the header file .pb.h, you will find the protobuf version used:

#if GOOGLE_PROTOBUF_VERSION < 2006000

Check if this is supposed to be the protoc version you should used. After that check what are the protobuf header you are using. If there is no correlation between your protoc version and your protobuf headers you have the message displayed.