A preparation environment:
1 Download and install mingw and MSYS
If you encounter problems during installation, refer to
http://blog.csdn.net/jszj/article/details/4028716
http://blog.csdn.net/lezhiyong/article/details/9842451
2 Download yasm
x264 compiling the code inside the assembly requires Yasm.exe
to the official website: http://yasm.tortall.net/Download.html
L Latest release:1.3.0
- Win32. exe (for 32-bit Windows)
I am here to directly rename the downloaded Yasm-1.3.0-win32.exe to Yasm.exe to the system directory: C:\WINDOWS\system32 .
In addition, the source can also be installed:
Download http://yasm.tortall.net/Download.html source code, the current source version is 1.3.0, download source. tar.gz, then unzip to D:\yasm-1.2.0
Enter Mingw+msys, execute msys.bat, execute command sequentially
cd/d/yasm-1.2.0 (Enter directory)
./configure carriage return (Execution configuration file)
Make enter (start compiling)
Make install enter (install)
After installation, a local directory will be created in the Msys directory, and all files under this directory will be copied to the Msys directory MinGW
3 Download x264 Latest Version (version 142)
Http://www.videolan.org/developers/x264.html
git clone git://git.videolan.org/x264.git
Historical version: ftp://ftp.videolan.org/pub/videolan/x264/snapshots/
After download, unzip to the Msys\1.0\home directory,
Two compilation steps
compiling x264
< Span style= "Color:black" >&NBSP;&NBSP;&NBSP;&NBSP; Double-click " c:\mingw\msys\1.0\msys.bat " Span style= "Color:black" > " , start " mingw32"
Switch to the directory where the current x264 is located:C:\MinGW\msys\1.0\home\x264,
then execute the following command:
$./configure--enable-shared
$ make
make takes a long time to wait for the compilation to finish.
in order to summarize the compilation results, proceed to the following command:
$ make Install
after completion, it will be generated in the x264 directory . LIBX264.DLL.A, libx264.a and other documents
three configuration let x264 generated at compile time windows dll corresponding lib
1, download Poxports
http://download.csdn.net/source/3036251 unzip to the installation directory where the VC is located, for example
D:\Program Files\Microsoft Visual Studio 9.0\vc\bin
Execute on the MinGW command line:
Pexports libx264-142.dll > libx264-142.def
lib/machine:ix86/def: Libx264-142.def
Note Some spaces especially the second sentence before two slashes.
will be in generated under the \msys\1.0\home\x264 directory
Libx264-142.lib
Libx264-142.dll
Windows compiles the latest version of x264