问题解决:找不到 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, std::allocator > 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

你可能感兴趣的:(填坑)