-
Notifications
You must be signed in to change notification settings - Fork 667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
protobuf版本问题导致的不能编译 #10
Comments
希望能帮忙解决一下编译问题,protobuf是https://github.com/google/protobuf/tree/3.6.x 源码编译安装的。 |
跟系统默认的protobuf冲突了 |
非常感谢 @zhanghan1992 ,不过又出现了连接问题,请您帮忙解决一下,麻烦了,多谢。 .... |
这里出错的原因是在安装leveldb的时候,在你的环境里找到了snappy.h的头文件,但没有找到libsnappy.a。
|
还是有点问题,麻烦您再帮忙看一下:
|
1."strings usr/local/lib64/libsnappy.a | grep RawCompress",检查链接不上的符号是否在这个版本的lib里; 检查是否存在usr/lib64/libsnappy.a。存在的话用上面的方法检查/usr/lib64/libsnappy.a。编译时优先从LIBRARY_PATH中写在前面的路径中找lib。 |
非常感谢,按照您的方法检查之后报错如下:
|
export CFLAGS="-fPIC" |
重新编译后还是出现了之前的报错信息,已经用strings检查过变量名,存在 /usr/local/lib64/libsnappy.a中,报错信息如下:
|
你可以先把环境里的snappy.h删掉,然后删除leveldb后重新编译 。编译leveldb时如果在环境里找不到snappy.h会编译不依赖snappy的版本。 |
解决了,多谢 |
config_brpc.sh: 32: config_brpc.sh: realpath: not found 您好,我也遇到了同样的问题,按照你说的这个方法弄了还是一样的错误,是什么原因呢,谢谢: |
@zhongyunuestc |
谢谢回复,已解决,我把那个脚本重新写了
在 2018-08-12 14:31:07,"zhanghan" <notifications@github.com> 写道:
@zhongyunuestc
环境里缺少realpath指令,需要安装realpath。
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
[ 98%] Linking CXX executable run_server 你好,请问你是怎么删除你环境里的snappy.h呢(怎么找到这个在哪个环境变量下面) |
@lingdavid
|
@zhanghan1992 |
你好,请问一下,在./run_server之后出现以下内容: |
@lingdavid |
core: No such file or directory |
@lingdavid
|
Core was generated by `./run_server'. |
@zhanghan1992 warning: exec file is newer than core file. |
您好, 我在编译过程中也遇到了liu946类似的protobuf的问题,不过我的protocol版本已经是最新,也试过了提供的解决方法,还是会报错: protoc --version 我是Ubuntu 16.04, Cuda 9.0 ,Python2.7 tensorflow-gpu 1.5.0 编译错误代码: |
我这样做了之后还是显示protoc版本低了,tensorflow是1.8.0的包 /mnt/disk1/home/ganshijie/AnyQ_tf/build/third_party/include/tf/tensorflow/core/framework/device_attributes.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is |
编译 log 如下:
[ 4%] Built target extern_leveldb
[ 9%] Built target extern_jsoncpp
[ 13%] Built target extern_gtest
[ 18%] Built target extern_xgboost
[ 22%] Built target extern_eigen
[ 26%] Built target extern_paddle
[ 31%] Built target extern_curl
[ 35%] Built target extern_lac
[ 39%] Built target extern_boost
[ 43%] Built target extern_zlib
[ 47%] Built target extern_protobuf
[ 52%] Built target extern_gflags
[ 57%] Built target extern_openssl
[ 61%] Built target extern_glog
[ 61%] Performing install step for 'extern_brpc'
Compiling src/mcpack2pb/generator.o
In file included from src/mcpack2pb/generator.cpp:27:0:
./src/idl_options.pb.h:12:2: 错误:#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
^
./src/idl_options.pb.h:13:2: 错误:#error incompatible with your Protocol Buffer headers. Please update
#error incompatible with your Protocol Buffer headers. Please update
^
./src/idl_options.pb.h:14:2: 错误:#error your headers.
#error your headers.
^
In file included from ./src/idl_options.pb.h:25:0,
from src/mcpack2pb/generator.cpp:27:
/usr/local/include/google/protobuf/generated_message_table_driven.h: 在函数‘bool google::protobuf::internal::ParseMap(google::protobuf::io::CodedInputStream*, void*)’中:
/usr/local/include/google/protobuf/generated_message_table_driven.h:185:20: 错误:expected nested-name-specifier before ‘MapEntryToMapField’
typedef typename MapEntryToMapField::MapFieldType MapFieldType;
^
/usr/local/include/google/protobuf/generated_message_table_driven.h:185:38: 错误:expected initializer before ‘<’ token
typedef typename MapEntryToMapField::MapFieldType MapFieldType;
^
/usr/local/include/google/protobuf/generated_message_table_driven.h:189:43: 错误:‘MapFieldType’在此作用域中尚未声明
typedef typename Entry::template Parser<MapFieldType, MapType> ParserType;
^
/usr/local/include/google/protobuf/generated_message_table_driven.h:191:33: 错误:expected type-specifier before ‘MapFieldType’
ParserType parser(static_cast<MapFieldType*>(map_field));
^
/usr/local/include/google/protobuf/generated_message_table_driven.h:191:33: 错误:expected ‘>’ before ‘MapFieldType’
/usr/local/include/google/protobuf/generated_message_table_driven.h:191:33: 错误:expected ‘(’ before ‘MapFieldType’
/usr/local/include/google/protobuf/generated_message_table_driven.h:191:46: 错误:expected primary-expression before ‘>’ token
ParserType parser(static_cast<MapFieldType*>(map_field));
^
In file included from ./src/idl_options.pb.h:27:0,
from src/mcpack2pb/generator.cpp:27:
/usr/local/include/google/protobuf/inlined_string_field.h: 在全局域:
/usr/local/include/google/protobuf/inlined_string_field.h:56:22: 错误:expected ‘;’ at end of member declaration
InlinedStringField()
^
/usr/local/include/google/protobuf/inlined_string_field.h:57:5: 错误:‘GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE’不是一个类型名
GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;
^
/usr/local/include/google/protobuf/inlined_string_field.h:61:56: 错误:expected ‘;’ at end of member declaration
const InlinedStringField& from)
^
/usr/local/include/google/protobuf/inlined_string_field.h:62:5: 错误:‘GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE’不是一个类型名
GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;
^
/usr/local/include/google/protobuf/inlined_string_field.h:64:69: 错误:expected ‘;’ at end of member declaration
void ClearToEmpty(const ::std::string* default_value, Arena* arena)
^
/usr/local/include/google/protobuf/inlined_string_field.h:65:7: 错误:‘GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE’不是一个类型名
GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {
^
/usr/local/include/google/protobuf/inlined_string_field.h:68:31: 错误:expected ‘;’ at end of member declaration
void ClearNonDefaultToEmpty() GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {
^
/usr/local/include/google/protobuf/inlined_string_field.h:68:33: 错误:‘GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE’不是一个类型名
void ClearNonDefaultToEmpty() GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {
^
/usr/local/include/google/protobuf/inlined_string_field.h:71:62: 错误:expected ‘;’ at end of member declaration
void ClearToEmptyNoArena(const ::std::string* default_value)
^
/usr/local/include/google/protobuf/inlined_string_field.h:72:7: 错误:‘GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE’不是一个类型名
GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {
^
/usr/local/include/google/protobuf/inlined_string_field.h:75:38: 错误:expected ‘;’ at end of member declaration
void ClearNonDefaultToEmptyNoArena()
^
/usr/local/include/google/protobuf/inlined_string_field.h:76:5: 错误:‘GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE’不是一个类型名
GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;
^
/usr/local/include/google/protobuf/inlined_string_field.h:78:71: 错误:expected ‘;’ at end of member declaration
void ClearToDefault(const ::std::string* default_value, Arena* arena)
^
/usr/local/include/google/protobuf/inlined_string_field.h:79:7: 错误:‘GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE’不是一个类型名
GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {
^
/usr/local/include/google/protobuf/inlined_string_field.h:82:64: 错误:expected ‘;’ at end of member declaration
void ClearToDefaultNoArena(const ::std::string* default_value)
^
/usr/local/include/google/protobuf/inlined_string_field.h:83:5: 错误:‘GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE’不是一个类型名
GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;
^
/usr/local/include/google/protobuf/inlined_string_field.h:85:64: 错误:expected ‘;’ at end of member declaration
void Destroy(const ::std::string* default_value, Arena* arena)
^
/usr/local/include/google/protobuf/inlined_string_field.h:86:7: 错误:‘GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE’不是一个类型名
GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {
^
/usr/local/include/google/protobuf/inlined_string_field.h:89:57: 错误:expected ‘;’ at end of member declaration
void DestroyNoArena(const ::std::string* default_value)
^
/usr/local/include/google/protobuf/inlined_string_field.h:90:5: 错误:‘GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE’不是一个类型名
GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;
^
/usr/local/include/google/protobuf/inlined_string_field.h:92:30: 错误:expected ‘;’ at end of member declaration
const ::std::string& Get() const GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {
^
/usr/local/include/google/protobuf/inlined_string_field.h:92:36: 错误:‘GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE’不是一个类型名
const ::std::string& Get() const GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {
^
/usr/local/include/google/protobuf/inlined_string_field.h:95:37: 错误:expected ‘;’ at end of member declaration
const ::std::string& GetNoArena() const GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;
^
/usr/local/include/google/protobuf/inlined_string_field.h:95:43: 错误:‘GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE’不是一个类型名
const ::std::string& GetNoArena() const GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;
^
/usr/local/include/google/protobuf/inlined_string_field.h:97:74: 错误:expected ‘;’ at end of member declaration
::std::string* Mutable(const ::std::string* default_value, Arena* arena)
^
/usr/local/include/google/protobuf/inlined_string_field.h:98:7: 错误:‘GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE’不是一个类型名
GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {
^
/usr/local/include/google/protobuf/inlined_string_field.h:101:67: 错误:expected ‘;’ at end of member declaration
::std::string* MutableNoArena(const ::std::string* default_value)
^
/usr/local/include/google/protobuf/inlined_string_field.h:102:5: 错误:‘GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE’不是一个类型名
GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;
^
/usr/local/include/google/protobuf/inlined_string_field.h:117:24: 错误:expected ‘;’ at end of member declaration
Arena* arena) GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {
^
/usr/local/include/google/protobuf/inlined_string_field.h:117:26: 错误:‘GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE’不是一个类型名
Arena* arena) GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {
^
/usr/local/include/google/protobuf/inlined_string_field.h:122:28: 错误:expected ‘;’ at end of member declaration
Arena* arena) GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {
^
/usr/local/include/google/protobuf/inlined_string_field.h:122:30: 错误:‘GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE’不是一个类型名
Arena* arena) GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {
^
/usr/local/include/google/protobuf/inlined_string_field.h:126:36: 错误:expected ‘;’ at end of member declaration
StringPiece value) GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;
^
/usr/local/include/google/protobuf/inlined_string_field.h:126:38: 错误:‘GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE’不是一个类型名
StringPiece value) GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;
^
/usr/local/include/google/protobuf/inlined_string_field.h:130:24: 错误:expected ‘;’ at end of member declaration
Arena* arena) GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {
^
/usr/local/include/google/protobuf/inlined_string_field.h:130:26: 错误:‘GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE’不是一个类型名
Arena* arena) GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {
^
/usr/local/include/google/protobuf/inlined_string_field.h:135:28: 错误:expected ‘;’ at end of member declaration
Arena* arena) GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {
^
/usr/local/include/google/protobuf/inlined_string_field.h:135:30: 错误:‘GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE’不是一个类型名
Arena* arena) GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE {
^
/usr/local/include/google/protobuf/inlined_string_field.h:139:45: 错误:expected ‘;’ at end of member declaration
const ::std::string& value)
^
/usr/local/include/google/protobuf/inlined_string_field.h:140:5: 错误:‘GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE’不是一个类型名
GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;
^
/usr/local/include/google/protobuf/inlined_string_field.h:154:37: 错误:expected ‘;’ at end of member declaration
void Swap(InlinedStringField* from)
^
/usr/local/include/google/protobuf/inlined_string_field.h:155:5: 错误:‘GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE’不是一个类型名
GOOGLE_PROTOBUF_ATTRIBUTE_ALWAYS_INLINE;
^
In file included from src/mcpack2pb/generator.cpp:27:0:
./src/idl_options.pb.h:42:16: 错误:‘FieldMetadata’不是命名空间‘google::protobuf::internal’中的一个类型名
static const ::google::protobuf::internal::FieldMetadata field_metadata[];
^
./src/idl_options.pb.h:43:16: 错误:‘SerializationTable’不是命名空间‘google::protobuf::internal’中的一个类型名
static const ::google::protobuf::internal::SerializationTable serialization_table[];
^
make[3]: *** [src/mcpack2pb/generator.o] 错误 1
make[2]: *** [third_party/brpc/src/extern_brpc-stamp/extern_brpc-install] 错误 2
make[1]: *** [CMakeFiles/extern_brpc.dir/all] 错误 2
make: *** [all] 错误 2
The text was updated successfully, but these errors were encountered: