即使nm报告存在符号,运行时符号查找错误 [英] Symbol lookup error at runtime even though nm reports symbol present

查看:158
本文介绍了即使nm报告存在符号,运行时符号查找错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我这样构建程序:

g++ -std=c++11 myprog.cpp -o myprog -lqpid-proton-cpp

然后我运行./myprog并收到此错误:

Then I run ./myprog and get this error:

symbol lookup error: ./myprog: undefined symbol: _ZN6proton10event_loop6injectESt8functionIFvvEE

但是,nm报告该库中存在该符号. .

Yet, nm reports the symbol is present in the library . . .

nm -D /usr/lib/libqpid-proton-cpp.so | grep _ZN6proton10event_loop6injectESt8functionIFvvEE

. . .产量:

000000000002f460 T _ZN6proton10event_loop6injectESt8functionIFvvEE

我在这里想念什么?

推荐答案

例如,您是否使用ldd myprog验证了自己是否查看了正确的共享库?有可能找到其他共享对象.

Did you verify, e.g., using ldd myprog, that you looked at the correct shared object? There is a chance a different shared object is found.

这篇关于即使nm报告存在符号,运行时符号查找错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆