I'm writing a small program using c++. It compiles right, but at execution time it displays this message:

error while loading shared libraries: libSDL2_mixer-2.0.so.0: cannot open shared object file: No such file or directory

I've installed this library and I see the file libSDL2_mixer-2.0.so.0 in folder '/usr/local/lib'

Any idea?

1

There are 1 best solutions below

2
On BEST ANSWER

Adding "export LD_LIBRARY_PATH=/usr/local/lib" in ~/.bashrc (at the end), as suggested here How to set the environmental variable LD_LIBRARY_PATH in linux.

Thanks