gpt4 book ai didi

c++ - GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 检查期间编译时出现 Protocol Buffer 错误

转载 作者:可可西里 更新时间:2023-11-01 15:56:38 26 4
gpt4 key购买 nike

我目前收到一个错误,它指向 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

但我的协议(protocol)版本与上面的版本匹配:

protoc --version
libprotoc 2.6.1

我做错了什么?

最初我的 protoc 版本是 3.0.0 然后通过同步回 2.6.1 并执行这些步骤重新安装它; make distclean, ./configure , make, make install 安装所需的 2.6.1 版本。我需要旧版本,因为那是我们服务器中安装的版本。

最佳答案

问题是您系统上安装的 header (在/usr/include/google/protobuf 或/usr/local/include/google/protobuf 中)来自比您的 protoc。可能是您在不同位置安装了两个版本,并且使用了错误的版本。

But my protoc version matches the one above:

是的,因为该代码是由您的 protoc 生成的,并且它知道自己的版本。代码询问:“我的版本 (2006001) 是否低于已安装 header 要求的最低版本 (GOOGLE_PROTOBUF_MIN_PROTOC_VERSION)?”

关于c++ - GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 检查期间编译时出现 Protocol Buffer 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35744529/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com