nm命令解决undefined reference to "xxx"

  nm 可以通过查看符号表查看so中是否定义了某个函数,这个特性可以用于解决如下情况:

           在某次编译过程中出现undefined reference to "xxx";

说明

           出现以上情况说明程序编译已经通过,但是在链接过程中"xxx"符号找不到来源(定义definition或说明declaration),往往出现在动态链接的过程中,需要在程序外部寻找到支持“xxx”的链接库。以某一次android ndk交叉编译过程中c++标准库缺失为例。

问题

third/CRF++-0.58/encoder.o:encoder.cpp:function std::basic_filebuf<char, std::char_traits<char> >::imbue(std::locale const&): error: undefined reference to 'std::locale::_M_get_facet(std::locale::id const&) const'
third/CRF++-0.58/encoder.o:encoder.cpp:function std::basic_filebuf<char, std::char_traits<char> >::imbue(std::locale const&): error: undefined reference to 'std::locale::_M_use_facet(std::locale::id const&) const'
third/CRF++-0.58/encoder.o:encoder.cpp:function std::basic_filebuf<char, std::char_traits<char> >::imbue(std::locale const&): error: undefined reference to 'std::locale::_M_use_facet(std::locale::id const&) const'
third/CRF++-0.58/encoder.o:encoder.cpp:function std::basic_filebuf<char, std::char_traits<char> >::imbue(std::locale const&): error: undefined reference to '__cxa_call_unexpected'
third/CRF++-0.58/encoder.o:encoder.cpp:function std::basic_filebuf<char, std::char_traits<char> >::imbue(std::locale const&): error: undefined reference to 'std::codecvt<char, char, mbstate_t>::id'
third/CRF++-0.58/encoder.o:enc
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值