Symbol lookup error at runtime even though nm reports symbol present

守給你的承諾、 提交于 2020-01-07 06:34:53

问题


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:

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

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

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

. . . yields:

000000000002f460 T _ZN6proton10event_loop6injectESt8functionIFvvEE

What am I missing here?


回答1:


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.



来源:https://stackoverflow.com/questions/44273095/symbol-lookup-error-at-runtime-even-though-nm-reports-symbol-present

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!