Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Finally I have managed to compile my program which uses ffmpeg library.</p> <p>For some reason I still couldn't compile it using gcc compiler, but I could do it with g++ compiler.</p> <p>When the static libraries are installed, all the dependencies must be specified explicitly, and the order of linking of these libraries is also important. So here is the compilation code which finally compiled my program:</p> <pre><code>g++ readVideo.cc -o readVideo $(pkg-config --libs --cflags libavformat) </code></pre> <p><code>pkg-config</code> here is a utility which prints all the flags and libraries that are needed to properly link the specified <code>libavformat</code> library.</p> <p>Also it's worth of mentioning, that the source file was renamed from readVideo.C to readVideo.cc, and that <code>#include</code> statements have been encompassed using <code>extern "C"</code> as follows:</p> <pre><code>extern "C" { #include &lt;libavformat/avformat.h&gt; } </code></pre> <p>It is needed because ffmpeg is a C project and program will not compile with C++ compiler if you don't explicitly state that it is C library.</p> <p>And if you don't want to bother with <code>pkg-config</code> to include all dependencies for ffmpeg libraries, you can install ffmpeg with shared libraries instead of static ones. Then it will compile by simpler call:</p> <pre><code>g++ readVideo.cc -o readVideo -lavformat </code></pre> <p>To install shared libraries, you need to add these 2 options to <code>./configure</code> program when installing ffmpeg:</p> <pre><code>--disable-static --enable-shared </code></pre> <p>Hope it helps somebody some time ...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload