Building FFMPEG for Visual Studio development
<p>I'm trying to use ffmpeg in Visual Studio 2013 C++ software (ultimately as part of an OpenCV project) - but right now I'm just trying to get basic FFMPEG functionality.  In general, when building in Visual Studio, I build 64--bit software with Multi-threaded DLL runtime libraries.  I have built ffmpeg using the general instructions for 'Native Windows compilation using ... MinGW-w64' at <a href="http://ffmpeg.org/platform.html#Windows" rel="nofollow">http://ffmpeg.org/platform.html#Windows</a> (I provide a more detailed set of steps I followed below...).  </p>

<p>After building the ffmpeg software on my system, I tried to create a simple 'hello world' project in Visual Studio 2013.  Specifically, I tried to implement the initial tutorial file presented at <a href="http://dranger.com/ffmpeg/tutorial01.html" rel="nofollow">http://dranger.com/ffmpeg/tutorial01.html</a>.  Upon building the project, I get the error:</p>

<blockquote>
  <p>c:\msys64\usr\local\ffmpeg\libavutil\common.h(45): fatal error C1083: Cannot
  open include file: 'libavutil/avconfig.h': No such file or directory</p>
</blockquote>

<p>The following are the detailed steps I took to build ffmpeg and create my basic Visual Studio project:</p>

<p>============ Building ffmpeg ===============</p>

<ol>
<li>Downloaded and intalled msys2-x86_64-20160205.exe from <a href="http://msys2.github.io" rel="nofollow">http://msys2.github.io</a></li>
<li>Ran <code>update-core</code> to update the Msys2 install</li>
<li>Ran <code>pacman -Suu</code> (twice) to complete the update (following the instructions about updating shortcuts, etc.)</li>
<li>Then I quit out of the MSys2 shell and opened the MinGW-w64 Win64 Shell.  In this new shell:</li>
<li>Installed the following packages using <code>pacman -S &lt;package-name&gt;</code>  The list of packages I installed is: make, pkg-config, diffutils, mingw-w64-x86_64-yasm, mingw-w64-x86_64-gcc, mingw-w64-x86_64-SDL, git</li>
<li>Then I cd'd into <code>cd /usr/local</code></li>
<li>Ran <code>git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg</code></li>
<li>I wanted to build the ffmpeg library 'out-of-tree' of this MSys64 folder.   So, in the regular file system of my Windows machine I created a folder at C:\ffmpeg</li>
<li>Back in the Win64 Shell, I cd'd to this new folder: <code>cd /c/ffmpeg</code></li>
<li>Then ran <code>/usr/loca/ffmpeg/configure --enable-shared</code></li>
<li>Then <code>make -r</code></li>
<li>And, finally <code>make install</code></li>
</ol>

<p>Now, if I had to guess, my 'flaw' was in the options I used when calling the 'configure' script of ffmpeg.  Do I need to use particular options so that I can take the ffmpeg libraries built here and use them as dynamic (DLL) libraries in Visual Studio?</p>

<p>========== Configuring my Visual Studio Project ============</p>

<p>Here's how I created a simple hello world project in Visual Studio to see if ffmpeg is working.</p>

<ol>
<li>I created a new Visual C++ 'Empty Project' in Visual Studio 2013</li>
<li><p>I then configured the project properties as follows:</p>

<p>a. In C/C++ => General => Additional Include Directories, I put</p>

<blockquote>
  <p>C:\msys64\usr\local\ffmpeg</p>
</blockquote>

<p>b. In Linker=>General => Additional Library Directories, I pointed to each of the built library folders (basically I pointed at <em>all</em> of the libraries that were built to ensure I was not inadvertently missing the critical one).  The list is as follows:</p>

<ul>
<li>C:\ffmpeg\libavcodec </li>
<li>C:\ffmpeg\libavdevice</li>
<li>C:\ffmpeg\libavfilter</li>
<li>C:\ffmpeg\libavformat</li>
<li>C:\ffmpeg\libavutil</li>
<li>C:\ffmpeg\libswresample</li>
<li>C:\ffmpeg\libswscale</li>
<li>C:\ffmpeg</li>
</ul>

<p>c. In Linker=> Input => Additional Dependencies, I pointed to the particular libraries (again - I pointed to all of the ones present).  The list is:</p>

<ul>
<li>avcodec.lib</li>
<li>avdevice.lib</li>
<li>avfilter.lib</li>
<li>avformat.lib</li>
<li>avutil.lib</li>
<li>swresample.lib</li>
<li>swscale.lib</li>
</ul></li>
<li><p>I then created a new source file called 'tut01.c' and copied/pasted the code from <a href="http://dranger.com/ffmpeg/tutorial01.c" rel="nofollow">http://dranger.com/ffmpeg/tutorial01.c</a></p></li>
<li>Then hit F7 and got the error specified above about not finding avconfig.h</li>
</ol>

<p>The above is my best guess as to the steps I need to follow to get this working in Windows (btw, it's Windows 10, 64-bit) &amp; Microsoft Visual Studio 2013.  What should I change to get this basic program to build and run?</p>