I am a C++ beginner. I have a c++ project that i built using the existing make files. I have a library that I linked from /usr/local/lib. Build is successful but when I run it, its complaining about the library that I linked form /usr/local/lib. If I copy that library to /lib64 and run my program, everything is fine. Please let me know what I should do to avoid this error. Thank you.
error while loading shared libraries: libactivemq-cpp.so.14: cannot
open shared object file: No such file or directory
Best Answer
As Oli explained, you can set
LD_LIBRARY_PATH
, but you can also install the library permanently, even if it doesn't live in one of the standard directories. Start withit's quite important you know how that thing works.
/lib
and/usr/lib
) will be picked up. I have no running 64 bits system available but i'm guessing on those the directories will be suffixed with 64/etc/ld.so.conf
ldconfig -v
and check if they actually got picked upAnd you'll be all set :-)