0

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
  • 13
  • 116
  • 190
Greg Clinton
  • 365
  • 1
  • 7
  • 18
  • 3
    Did you verify, e.g., using `ldd myprog`, that you looked at the correct shared object? – Dietmar Kühl May 30 '17 at 22:51
  • @Dietmar, no, I didn't. I was unaware of ldd. Running `ldd myprog` revealed to me a different copy of the so. I removed it and now my program works. Thank you very much. Maybe post this as an answer. – Greg Clinton May 30 '17 at 23:03

1 Answers1

2

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.

Dietmar Kühl
  • 150,225
  • 13
  • 225
  • 380