Protobuf在Ubuntu上不编译

Protobuf on Ubuntu not compiling

本文关键字:编译 Ubuntu Protobuf      更新时间:2023-10-16

i不能在ubuntu上使用Protobuf编译。这是错误:

错误:#error这个文件是由较新版本的protoc生成的 #Error此文件是由较新版本的Protoc生成的 ^ build/x86_64/gen/rtbkit/plugins/exchange/realtime-bidding.pb.h:13:2:错误:#Error与协议缓冲区的标头不相容。请更新 #Error与您的协议缓冲区标头不兼容。请更新 ^ build/x86_64/gen/rtbkit/插件/Exchange/reace-bidding.pb.h:14:2:错误:#eRROR您的标题。 #误导你的标题。 ^ 在build/x86_64/gen/rtbkit/plugins/exchange/实量bidding.pb.cc:5:0中包含的文件中 build/x86_64/gen/rtbkit/rtbkit/plugins/exchange/realtime-bidding.pb.h:26:55:致命错误:google/protobuf/generated_enum_reflection.h:没有这样的文件或目录 #包括 ^

我删除了它,它仍然显示Protobuf 2.5

这是Protobuf的常见问题。您需要仔细检查您正在使用的protoc以及所使用的标头,如果您安装了2个版本,则尤其如此!在标题文件.pb.h中,您将找到使用的Protobuf版本:

#if GOOGLE_PROTOBUF_VERSION < 2006000

检查是否应该是您应该使用的原始版本。之后,检查您使用的Protobuf标头是什么。如果您的原始版本与Protobuf标题之间没有相关性,则显示显示的消息。