ActiveMQ: Error while loading shared libraries

1k views Asked by At

I have a C++ project that runs standalone, by launching its binary on console. However it does not run when I try on Eclipse, giving the following error:

 error while loading shared libraries: libactivemq-cpp.so.18: cannot open shared object file: No such file or directory

I do know that the error is related to LD_LIBRARY_PATH, as I set it before launching on console and it runs, otherwise it also gives the same error there. I want to do the same in Eclipse too, and I guess I am doing that already. I am setting the environment variable from Windows->Preferences and so on, however it does not work.

Is there anyone who knows how to tackle this problem in Eclipse environment?

2

There are 2 answers

0
AudioBubble On BEST ANSWER

Fixed it by adding the following line as make variable in the makefile.

LD_LIBRARY_PATH:=../libs
0
Kiwi On

I recently faced the same error. The problem has different circumstances, but I'd like to share my solution for others who find this.

In my case the application is Linux based. It seems the $ make install command failed due to wrong permissions, leading to missing libraries in the local library cache. That's why I got the error error while loading shared libraries: libactivemq-cpp.so.19: cannot open shared object file: No such file or directory in the first place.

After fixing the permissions and rerun the $ make install command, the error would persist, because the OS library cache was not refreshed.

After executing:

$ sudo /sbin/ldconfig

all required libraries could be found and the program worked just fine.