title: FFmpeg doesn't compile with shared libraries
body: <p>I ran the <code>./configure</code> script of FFmpeg as follows:</p>
  
  <p><code>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
  </code></p>
  
  <p>When I try to compile FFmpeg with <code>--enable-shared</code> option as above, I get this error:</p>
  
  <p><code>/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</code></p>
  
  <p>I had added <code>--enable-pic</code> ,<code>--extra-ldexeflags=-pie</code> as well as <code>-fPIC -m64</code> to <code>--extra-cflags</code> in order to get rid of this relocation error as suggested here: <a href="https://www.ffmpeg.org/platform.html" rel="noreferrer">https://www.ffmpeg.org/platform.html</a></p>
  
  <p>But I'm still getting the same error. I need to compile ffmpeg with <code>--enable-shared</code> option to interface it with OpenCV, so I have to find a workaround here.</p>