问题解决:找不到 libthrift.so 中的 getPending、TServerSocket、updatePending函数

解决方案:

使用C++11进行编译

解决过程:

在这里插入图片描述

使用 nm 进行查看:

有问题的库:
[root@cf0428daeba8 lib]# aarch64-himix100-linux-nm -C libthrift.so |grep updatePending
000000000003db60 T apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::string const&, apache::thrift::protocol::TMessageType, int)
正常的库:
[root@cf0428daeba8 lib]# aarch64-himix100-linux-nm -C libthrift.so |grep updatePending
000000000003ec80 T apache::thrift::async::TConcurrentClientSyncInfo::updatePending(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, apache::thrift::protocol::TMessageType, int)

估计原因是没指定使用C++11进行编译,故进行了编译器版本降级。查看CMake的编译过程,找到这么一句,基本印证猜想。

--  Language libraries:
--   Build C++ library:                          ON
--     C++ Language Level:                       C++11 [fallback to earlier if compiler does not support it]

由于我们是使用 Conan 进行编译管理,查看 Conan 中关于 C++11 使用的相关Issue ‘settings.compiler.libcxx’ value not defined

the reason is that we much prefer it to be explicit, rather than the compiler default, because the bad thing is that there is not such compiler default, a modern gcc 5.X might use libstdc++ as default in old distros (which are very common in CIs like travis) and libstdc++11 in modern distros.

故如果需要使用 C++11 的特性,需要在 settings 中显示声明 compiler.libcxx=libstdc++11

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值