1、描述
接入sdk, libshared.so, 编译时包含了libprotobuf.a, 但本地使用的brpc库,libbrpc.so编译依赖本地libprotobuf.so, 导致冲突
[libprotobuf FATAL google/protobuf/stubs/common.cc:79] This program was compiled against version 2.5.0 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.5.1). Contact the program author for an update. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "google/protobuf/descriptor.pb.cc".)
terminate called after throwing an instance of 'google::protobuf::FatalException'
what(): This program was compiled against version 2.5.0 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.5.1). Contact the program author for an update. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "google/protobuf/descriptor.pb.cc".)
2、解决
修改libShared.so编译脚本中, 编译依赖库protobuf时,添加命令: -fvisibility=hidden
./configure --with-pic --disable-shared --enable-static "CFLAGS=-fvisibility=hidden"
3、命令:
查询对外符号:
nm -CD libshared.so | grep " T" | grep google
临时添加链接目录:
export LD_LIBRARY_PATH=XXX
trol over symbol exports in GCCaaaa
Control over symbol exports in GCC
posted on 2020-10-14 17:18
长戟十三千 阅读(3808)
评论(0) 编辑 收藏 引用 所属分类:
编程技巧随笔