协议缓冲区错误版本
Protocol Buffer Error version
我正在尝试安装 Caffe 库,但由于我的系统中安装了错误的 protobuf 版本,我遇到了编译问题。
In file included from .build_release/src/caffe/proto/caffe.pb.cc:5:0:
.build_release/src/caffe/proto/caffe.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is
^
.build_release/src/caffe/proto/caffe.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
#error incompatible with your Protocol Buffer headers. Please
^
.build_release/src/caffe/proto/caffe.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
#error regenerate this file with a newer version of protoc.
我遵循了论坛中提出的许多方法,我认为这篇文章中讨论了最相似的问题。
在 caffe.pb.h 中,控件为:
#if 3002000 < 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
但是在我的系统头(/usr/include/google/protobuf/stubs/common.h(中:
The current version, represented as a single integer to make comparison
easier: major * 10^6 + minor * 10^3 + micro
define GOOGLE_PROTOBUF_VERSION 2005000
从终端命令 protoc --version 返回 libprotoc3.2.0。
所以我安装了 3.2 版本,但系统标题没有更新。 一位用户在上一篇文章中评论说:"我想出了一种方法,通过在 PATH 变量中首先指定我想要的 protobuf,而不必删除其他版本的 protobuf(其他事情取决于旧版本(。
有人可以一步一步地解释我如何遵循这一点吗? 或者,我可以更新系统标头吗?有许多元素连接到libprotoc,所以我想避免损坏它们。
谢谢
我在电脑上解决了这个问题,也许它可以帮助你。我的环境是 Ubuntu16.04,在安装 Caffe 之前我安装了 Anaconda(适用于 python2.7(。碰巧我使用 conda 来安装 libprotobuf-dev,这导致与 caffe 的"sudo apt-get install libprotobuf-dev"命令冲突,因为"apt-get"和 conda 在我的计算机上安装不同,可以通过"定位 protobuf"找到,所以我删除了 Anaconda 版本的 libprotobuf,再也没有问题发生。
conda uninstall libprotobuf
conda uninstall protobuf
当你在安装Caffe 之前安装 tensorflow 时,由于 libprotobuf 冲突,这个问题也会发生。
- FindPackageHandleStandardArgs.cmake:137 的 CMake 错误(消息):找不到 Boost (缺少:正则表达式)(找到合适的版本"1.72.0",
- C++中"覆盖功能的异常规范比基本版本更宽松"的奇怪错误
- 我将 Makefile 更改为 C++11 版本,但仍然收到列表初始值设定项错误
- 链接库错误 c/缺少 dll/错误版本?
- 创建 OpenCV 非自由版本 v4.3 时出错,可折叠.cpp错误 C2039、2605
- 解决与构建"Debug x64"版本的暗网相关的错误
- 成功完成TLS握手后,服务器关闭时出现错误的SSL例程:SSL3_GET_RECORD:错误的版本号
- Qt 应用程序中与Qt版本相关的运行时错误
- C++发布版本中的未来错误值
- 使用FFMPEG代码的RTSP服务器的FFMPEG版本错误
- AWS 上的 GLIBCXX 版本错误
- 致命错误 C1189:#error:Windows SDK 版本错误
- OpenGL着色器版本错误
- 类中调用的重写[]运算符的版本错误
- svn - OS x 上的 Qt Creator 版本错误
- 开发人员C++编译器内部版本错误
- 运行在同一台计算机上编译的程序时,GLIBCXX版本错误
- Qt5 OpenGL GLSL版本错误
- c++ OpenGL着色版本错误- GLSL x不支持[Ubuntu 16.04]
- libstdc++ GLIBCXX版本错误