I am creating ffmpeg with librtmp. My librtmp is located in / opt / librtmp / lib. When I execute ffmpeg, he said:
./ffmpeg: error while loading shared libraries: librtmp.so.0: cannot open shared object file: No such file or directory
I use the ldd command, it shows not found :
[ qty@testing bin]
I know like this:
[ qty@testing bin]
I found several ways to fix the problem.
- modify /etc/ld.so.conf, but it required a dinner user
- set the LD_LIBRARY_PATH variable, but it is not acceptable to users.
- pass rpath to gcc for example
configure args for my ffmpeg
PKG_CONFIG_PATH="/opt/librtmp/lib/pkgconfig" ./configure --disable-doc \ --disable-ffserver --disable-avdevice \ --disable-postproc --disable-avfilter --disable-bsfs \ --disable-filters \ --disable-asm \ --disable-bzlib \ --enable-librtmp \ --prefix=/opt/ffmpeg \ --extra-ldflags="-Wl,-rpath,/opt/librtmp/lib"
Suppose there is no source code to recompile? How to add a shared library search path to an executable?
qrtt1
source share