概述
下载http://videolan.mirror.aussiehq.net.au/x264/snapshots/
编译要注意编译器是x86 or x64,如果是64位一定要编译64bit的想64,否则会报找不到函数的错误(LNK2019未定义引用),即使包含目录正确。
具体方法:(转自http://blog.sina.com.cn/s/blog_5f435c130102wq1x.html)
-
Download from here http://xhmikosr.1f0.de/tools/ file named as MSYS_MinGW-w64_GCC_492_x86-x64_Full.7z and extract folder MSYS into root of disk C:/, for example.
So now we have C:MSYS folder. -
Now we need to run post-install script to configure build environment.
Run C:MSYSpostinstallpi.bat
To the question “Do you have MinGW installed? [yn ]” answer Y.
“Where is your MinGW installation?” - type C:/MSYS/mingw
- Download and compile necessary components.
-
tar xvjf last_x264.tar.bz2
-
Configure -
cd ~/x264-snapshot-20130917-2245
./configure --cross-prefix=x86_64-w64-mingw32- --host=x86_64-w64-mingw32 --enable-shared --disable-asm
(默认安装在c:/MSYS/usr/local下) -
Build and install -
make -j4
make install
得到的在/usr/local下,直接把lib/libx264.dll.a 改成libx264.lib
关于VS和qt配置
vs配置包含目录,指定为local下的include,链接器中输入添加libx264.lib,注意吧bin/dll文件和lib文件拷到cpp同目录下。
qt同样拷贝dll和lib到编译的debug目录,
pro文件:
LIBS += …/libx264.lib
INCLUDEPATH += …/include
最后
以上就是温婉鞋垫为你收集整理的记录x264编译的全部内容,希望文章能够帮你解决记录x264编译所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复