问题
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