问题描述
我下载了X264源和安装MinGW的。
I downloaded the X264 source and installed mingw.
第1步:
在MinGW的bash中执行该:
Executed this in the MINGW bash:
./配置--disable-CLI --enable-共享--enable-win32thread -
- 额外-LDFLAGS =轮候册, - 输出高清= libx264.def
./configure --disable-cli --enable-shared --enable-win32thread --extra-ldflags=-Wl,--output-def=libx264.def
然后是'化妆'
第二步:
改名为libx264-142.dll和libx264.dll开辟VS2012命令提示符并执行这样的:
Renamed the libx264-142.dll to libx264.dll and Opened up VS2012 Command Prompt and executed this:
LIB /DEF:libx264.def
LIB /DEF:libx264.def
这给了我libx264.lib和对象libx264.exp
which gave me libx264.lib and object libx264.exp
步骤3:
包括在使用X264 API一个VS2012项目的lib文件。
Included the lib file in a VS2012 project which uses the X264 API.
问题:
当我启动项目我收到以下错误信息:
When I start the project I get the following error message:
程序无法启动,因为libx264.dll从计算机中缺少
"The program can't start because libx264.dll is missing from your computer"
问:
为什么要找的DLL当我在链接静态库?
Why is it looking for the dll when I'm linking the static library in?
我该如何解决这个问题?我想建立一个静态库的X264,我可以用我的项目链接
How do I resolve this? I would like to build a static X264 library which I can link in with my project.
编辑:
我不得不把DLL在同一个目录作为该项目的可执行文件。
I just had to put the dll in the same directory as the project executable.
不过 - 我的问题依然存在:如何建立一个的静态的X264库?所以,我并不需要的DLL?
However - My question still stands: How do I build a static x264 library? So I don't need the dll?
推荐答案
X264可以通过建立项目MSVS可用静态库的最新更新之后。对于这样的库编译你将需要:
After the latest update of x264 you can build static library usable by MSVS project. For such library compilation you will need:
- MSYS和MSVS 2013更新2(如果安装更新前2 preSS版本[适用于Windows桌面]也将工作)
- 运行VS2013 86本机工具命令提示符或VS2013或x64原生工具命令提示符,这取决于什么版本(32位或64位)你想建立
- 更改目录到X264的路径和运行MSYS壳(SH)
- 从shell中运行CC = CL的./configure --disable-CLI --enable-静为X264配置
- 运行制造这应该从MSVS建立libx264.lib可用
P.S。 MSVS建会超过一个构建慢一点点通过的MinGW
P.S. MSVS builds would be a little bit slower than one build by MinGW
这篇关于窗户:如何构建,而不是.dll文件X264.lib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!