1.下载x264源文件
http://www.videolan.org/developers/x264.html
2.下载和安装Mingw
http:://www.mingw.org
安装时全装
3.添加VC支持
mingw\msys\1.0\msys.bat的文件开始处添加。比如我加的是:call D:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat
4.将下载的x264源码拷贝至mingw\msys\1.0\home\的user目录下
5.配置和编译
./configure --enable-shared --disable-asm
make
6.至此会生成x264库文件。
libx263-125.dll
生成lib库,需要工具pexports ,下载地址:http://www.emmestech.com/software/pexports-0.43/download_pexports.html
7生成lib库
pexports libx264-112.dll > libx264-112.def
lib /machine:ix86 /def:libx264-112.def
lib /machine:ix86 /def:libx264-112.def
8.测试xlib库
拷贝新生成的库libx264-112.lib和libx264-112.dll到新建的win32 工程下
拷贝原x264目录下的x264.h与x264_config.h至所建的win32工程下
下载pthreadGC2.dll和stdint.h
用如下程序测试
#include <iostream>
#include <string>
#include "stdint.h"
extern "C"
{
#include "x264.h"
#include "x264_config.h"
};
using namespace std;
int main()
{
x264_param_t param;
x264_param_default(¶m);
return 0;
}