加载共享库时出错:libSDL2_mixer-2.0.so.0:无法打开共享对象文件:Raspberry Pi 上没有此类文件或目录

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

我正在使用 C++ 编写一个小程序。它编译正确,但在执行时显示此消息:

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

我已经安装了这个库,我在文件夹“/usr/local/lib”

中看到文件 libSDL2_mixer-2.0.so.0

有什么想法吗?

在 ~/.bashrc(末尾)中添加 "export LD_LIBRARY_PATH=/usr/local/lib",如此处所建议 How to set the environmental variable LD_LIBRARY_PATH in linux

谢谢