I ran the ./configure script FFmpeg as follows:
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --pkg-config-flags="--static" --extra-cflags="-fPIC -m64 -I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-pic --extra-ldexeflags=-pie --enable-shared
When I try to compile FFmpeg with the --enable-shared option as above, I get this error:
/usr/bin/ld: /home/guel/ffmpeg_build/lib/libx264.a(common.o): relocation R_X86_64_32 against '.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /home/guel/ffmpeg_build/lib/libx264.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status
I added --enable-pic , --extra-ldexeflags=-pie , as well as -fPIC -m64 in --extra-cflags to get rid of this move error, as suggested here: https://www.ffmpeg.org /platform.html
But I still get the same error. I need to compile ffmpeg with the --enable-shared option to associate it with OpenCV, so I need to find a workaround here.
source share