Kyborg2011
Kyborg2011

Reputation: 606

FFMPEg and gcc problem

The problem is this: I wrote a simple program that uses FFMPEG. compile as follows:


gcc -lavcodec -lavformat -lavutil -c test.c

gcc -lavcodec -lavformat -Lavut -o test test.o

Compiled without problems, test file appears, but when you start: . / test An error occurs:

. / test: error while loading shared libraries: libavcodec.so.53: cannot open shared object file: No such file or directory

At what ffmpeg was originally built and installed and the file libavcodec.so.53 there. In what may be the problem?

Upvotes: 0

Views: 1214

Answers (1)

Kerrek SB
Kerrek SB

Reputation: 477010

You appear to be linking against libraries in a custom library directory, -Lavut.

Check where your loader looks for the executable's libraries:

ldd ./test

If any of them are in non-standard directories (and ldd indicates that a particular library couldn't be found), append those to the LD_LIBRARY_PATH:

LD_LIBRARY_PATH=/tmp/work/avut ./test

If you like, you can hardcode the library path into the executable with the -rpath linker option, e.g. gcc ... -Wl,-rpath -Wl,/tmp/work/avut.

Upvotes: 1

Related Questions