简体   繁体   English

即使nm报告存在符号,运行时符号查找错误

[英]Symbol lookup error at runtime even though nm reports symbol present

I build my program like this: 我这样构建程序:

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

Then I run ./myprog and get this error: 然后我运行./myprog并收到此错误:

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

Yet, nm reports the symbol is present in the library . 但是,nm报告该库中存在该符号。 . .

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

. . . yields: 产量:

000000000002f460 T _ZN6proton10event_loop6injectESt8functionIFvvEE

What am I missing here? 我在这里想念什么?

Did you verify, eg, using ldd myprog , that you looked at the correct shared object? 您是否使用ldd myprog验证了您是否查看了正确的共享库? There is a chance a different shared object is found. 有可能找到其他共享对象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM