title: static link to ldd output libraries
body: <p>Static link to ldd output dynamic libraries except for glibc.</p>
  
  <p>I've been using ffmpeg to extract rtsp key frames and I want to make the c program work on xilinx zyqn board after static compiling. But after trying several times, I still could not make it work.</p>
  
  <p>Here is the output of ldd:</p>
  
  <pre><code>linux-vdso.so.1 =&gt;  (0x00007fff8b1cf000)
  
  libavutil-ffmpeg.so.54 =&gt; /usr/lib/x86_64-linux-gnu/libavutil-ffmpeg.so.54 (0x00007f12f1da9000)
  libavformat-ffmpeg.so.56 =&gt; /usr/lib/x86_64-linux-gnu/libavformat-ffmpeg.so.56 (0x00007f12f19aa000)
  libavcodec-ffmpeg.so.56 =&gt; /usr/lib/x86_64-linux-gnu/libavcodec-ffmpeg.so.56 (0x00007f12f0579000)
  libc.so.6 =&gt; /lib/x86_64-linux-gnu/libc.so.6 (0x00007f12f01af000)
  libm.so.6 =&gt; /lib/x86_64-linux-gnu/libm.so.6 (0x00007f12efea6000)
  libpthread.so.0 =&gt; /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f12efc89000)
  libdl.so.2 =&gt; /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f12efa85000)
  libssh-gcrypt.so.4 =&gt; /usr/lib/x86_64-linux-gnu/libssh-gcrypt.so.4 (0x00007f12ef83c000)
  librtmp.so.1 =&gt; /usr/lib/x86_64-linux-gnu/librtmp.so.1 (0x00007f12ef620000)
  libz.so.1 =&gt; /home/wyh/miniconda2/lib/libz.so.1 (0x00007f12ef409000)
  libmodplug.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libmodplug.so.1 (0x00007f12ef07e000)
  libgme.so.0 =&gt; /usr/lib/x86_64-linux-gnu/libgme.so.0 (0x00007f12eee30000)
  libbluray.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libbluray.so.1 (0x00007f12eebe7000)
  libgnutls.so.30 =&gt; /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007f12ee8b7000)
  libbz2.so.1.0 =&gt; /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f12ee6a7000)
  libswresample-ffmpeg.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libswresample-ffmpeg.so.1 (0x00007f12ee48a000)
  libva.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libva.so.1 (0x00007f12ee26e000)
  libzvbi.so.0 =&gt; /usr/lib/x86_64-linux-gnu/libzvbi.so.0 (0x00007f12edfe3000)
  libxvidcore.so.4 =&gt; /usr/lib/x86_64-linux-gnu/libxvidcore.so.4 (0x00007f12edccf000)
  libx265.so.79 =&gt; /usr/lib/x86_64-linux-gnu/libx265.so.79 (0x00007f12ed0b0000)
  libx264.so.148 =&gt; /usr/lib/x86_64-linux-gnu/libx264.so.148 (0x00007f12ecd0c000)
  libwebp.so.5 =&gt; /usr/lib/x86_64-linux-gnu/libwebp.so.5 (0x00007f12ecab0000)
  libwavpack.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libwavpack.so.1 (0x00007f12ec887000)
  libvpx.so.3 =&gt; /usr/lib/x86_64-linux-gnu/libvpx.so.3 (0x00007f12ec463000)
  libvorbisenc.so.2 =&gt; /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2 (0x00007f12ec1ba000)
  libvorbis.so.0 =&gt; /usr/lib/x86_64-linux-gnu/libvorbis.so.0 (0x00007f12ebf8f000)
  libtwolame.so.0 =&gt; /usr/lib/x86_64-linux-gnu/libtwolame.so.0 (0x00007f12ebd6c000)
  libtheoraenc.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libtheoraenc.so.1 (0x00007f12ebb2d000)
  libtheoradec.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libtheoradec.so.1 (0x00007f12eb913000)
  libspeex.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libspeex.so.1 (0x00007f12eb6fa000)
  libsnappy.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libsnappy.so.1 (0x00007f12eb4f2000)
  libshine.so.3 =&gt; /usr/lib/x86_64-linux-gnu/libshine.so.3 (0x00007f12eb2e5000)
  libschroedinger-1.0.so.0 =&gt; /usr/lib/x86_64-linux-gnu/libschroedinger-1.0.so.0 (0x00007f12eb010000)
  libopus.so.0 =&gt; /usr/lib/x86_64-linux-gnu/libopus.so.0 (0x00007f12eadc6000)
  libopenjpeg.so.5 =&gt; /usr/lib/x86_64-linux-gnu/libopenjpeg.so.5 (0x00007f12eaba3000)
  libmp3lame.so.0 =&gt; /usr/lib/x86_64-linux-gnu/libmp3lame.so.0 (0x00007f12ea92e000)
  libgsm.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libgsm.so.1 (0x00007f12ea720000)
  libcrystalhd.so.3 =&gt; /usr/lib/x86_64-linux-gnu/libcrystalhd.so.3 (0x00007f12ea505000)
  liblzma.so.5 =&gt; /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f12ea2e3000)
  /lib64/ld-linux-x86-64.so.2 (0x00007f12f2018000)
  librt.so.1 =&gt; /lib/x86_64-linux-gnu/librt.so.1 (0x00007f12ea0db000)
  libgcrypt.so.20 =&gt; /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f12e9dfa000)
  libgssapi_krb5.so.2 =&gt; /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f12e9bb0000)
  libhogweed.so.4 =&gt; /usr/lib/x86_64-linux-gnu/libhogweed.so.4 (0x00007f12e997d000)
  libnettle.so.6 =&gt; /usr/lib/x86_64-linux-gnu/libnettle.so.6 (0x00007f12e9747000)
  libgmp.so.10 =&gt; /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f12e94c7000)
  libstdc++.so.6 =&gt; /home/wyh/miniconda2/lib/libstdc++.so.6 (0x00007f12e918d000)
  libgcc_s.so.1 =&gt; /home/wyh/miniconda2/lib/libgcc_s.so.1 (0x00007f12e8f7b000)
  libxml2.so.2 =&gt; /usr/lib/x86_64-linux-gnu/libxml2.so.2 (0x00007f12e8bc0000)
  libfontconfig.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f12e897d000)
  libfreetype.so.6 =&gt; /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f12e86d3000)
  libp11-kit.so.0 =&gt; /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007f12e846f000)
  libidn.so.11 =&gt; /usr/lib/x86_64-linux-gnu/libidn.so.11 (0x00007f12e823c000)
  libtasn1.so.6 =&gt; /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007f12e8029000)
  libsoxr.so.0 =&gt; /usr/lib/x86_64-linux-gnu/libsoxr.so.0 (0x00007f12e7dc4000)
  libpng12.so.0 =&gt; /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f12e7b9f000)
  libnuma.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libnuma.so.1 (0x00007f12e7994000)
  libogg.so.0 =&gt; /usr/lib/x86_64-linux-gnu/libogg.so.0 (0x00007f12e778b000)
  liborc-0.4.so.0 =&gt; /usr/lib/x86_64-linux-gnu/liborc-0.4.so.0 (0x00007f12e750b000)
  libgpg-error.so.0 =&gt; /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f12e72f7000)
  libkrb5.so.3 =&gt; /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007f12e7025000)
  libk5crypto.so.3 =&gt; /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007f12e6df6000)
  libcom_err.so.2 =&gt; /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f12e6bf2000)
  libkrb5support.so.0 =&gt; /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007f12e69e7000)
  libicuuc.so.55 =&gt; /usr/lib/x86_64-linux-gnu/libicuuc.so.55 (0x00007f12e6653000)
  libexpat.so.1 =&gt; /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f12e642a000)
  libffi.so.6 =&gt; /home/wyh/miniconda2/lib/libffi.so.6 (0x00007f12e6221000)
  libgomp.so.1 =&gt; /home/wyh/miniconda2/lib/libgomp.so.1 (0x00007f12e5ffe000)
  libkeyutils.so.1 =&gt; /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007f12e5dfa000)
  libresolv.so.2 =&gt; /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f12e5bdf000)
  libicudata.so.55 =&gt; /usr/lib/x86_64-linux-gnu/libicudata.so.55 (0x00007f12e4128000)
  
  </code></pre>
  
  <p>How can I correctly link to the all the static libs above? Thanks a lot!</p>