作者:ds87vdsa | 来源:互联网 | 2023-01-29 19:29
我正在尝试安装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
但是在我的系统标题中(/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返回libprotoc 3.2.0.
所以我安装了3.2版本但系统头文件没有更新.上一篇文章中的一位用户评论说'我想通过在PATH变量中首先指定我想要的protobuf,而不必删除其他版本的protobuf(其他依赖于旧版本的东西).
有人可以一步一步地解释我如何遵循这个?或者,我可以更新系统标头吗?有许多元素连接到libprotoc所以我想避免损坏它们.
谢谢