質問

I'm trying to play an mp3 file in terminal using C and I followed this link to do so. I've installed the two libraries libmpg123 and libao. Also, I've compiled the play.c program using the command:

gcc -O2 -o play play.c -lmpg123 -lao

But I get the following error when I run it:

./play: error while loading shared libraries: libao.so.4: cannot open shared object file: No such file or directory

Can you figure it out why it happened.

役に立ちましたか?

解決

The executable can be linked, but at run-time, it cannot find the shared libraries. Add the libraries to your LD_LIBRARY_PATH so the program can find them at run time.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top