写一个备忘在这里,免得下次不记得了,又从头再来。
ffmpeg compile with Visual C++ compatibility
ffmpeg compile with Visual C++ compatibility
- Install Visual C++ (if you haven't done so already).
- Install MinGW and MSYS as described above.
- Add a call to `vcvars32.bat' (which sets up the environment variables for the Visual C++ tools) as the first line of `msys.bat'. The standard location for `vcvars32.bat' is `C:/Program Files/Microsoft Visual Studio 8/VC/bin/vcvars32.bat', and the standard location for `msys.bat' is `C:/msys/1.0/msys.bat'. If this corresponds to your setup, add the following line as the first line of `msys.bat':
call "C:/Program Files/Microsoft Visual Studio 8/VC/bin/vcvars32.bat"
- Start the MSYS shell (file `msys.bat') and type
link.exe
. If you get a help message with the command line options oflink.exe
, this means your environment variables are set up correctly, the Microsoft linker is on the path and will be used by FFmpeg to create Visual-C++-compatible import libraries. - Extract the current version of FFmpeg and change to the FFmpeg directory.
- Type the command
./configure --enable-shared --disable-static --enable-memalign-hack
to configure and, if that didn't produce any errors, typemake
to build FFmpeg. - The subdirectories `libavformat', `libavcodec', and `libavutil' should now contain the files `avformat.dll', `avformat.lib', `avcodec.dll', `avcodec.lib', `avutil.dll', and `avutil.lib', respectively. Copy the three DLLs to your System32 directory (typically `C:/Windows/System32').