随笔 - 137  文章 - 1  trackbacks - 0
<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

常用链接

留言簿

随笔分类

随笔档案

收藏夹

调试技巧

搜索

  •  

最新评论

阅读排行榜

评论排行榜

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 长戟十三千 阅读(3677) 评论(0)  编辑 收藏 引用 所属分类: 编程技巧随笔

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理