Visual Studio 2010和QT 4.7.1静态链接
有一个问题,应用程序仍然需要 MSVCR100.dll 和 MSVCR100.dll。
构建 QT 源:
- set QMAKESPEC=win32-msvc2010
- configure -platform win32-msvc2010 -static
- nmake
安装后,我正在设置我的项目并将选项设置为 /MT /ZI。尽管如此 - 我的项目需要 MSVCR100.dll 和 MSVCR100.dll。
There is a problem, app still need MSVCR100.dll and MSVCR100.dll.
Build QT source:
- set QMAKESPEC=win32-msvc2010
- configure -platform win32-msvc2010 -static
- nmake
After install i am setuping my project ans set options to /MT /ZI. Still - my project wants MSVCR100.dll and MSVCR100.dll.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
应该是这样的。
来自 QT 文档:
“Qt 是使用 -MD(d) 开关构建的,该开关链接到动态 C/C++ 运行时库。这是必要的,因为我们在使用除 -MD(d) 以外的任何东西时都遇到过内存问题。 ) 标志,一般情况下,建议您不要为您的应用程序自行更改此标志,因为如果将标志更改为 -MT,它会与 Qt 库的构建方式发生冲突。您不应为 Qt 更改它。要么,因为它可能会导致问题”
可以在此处找到更多信息:
http: //qt-project.org/faq/answer/why_does_a_statically_built_qt_use_the_dynamic_visual_studio_runtime_librar
It is supposed to be that way.
From the QT documentation:
"Qt is built using the -MD(d) switch, which links against the dynamic C/C++ runtime libraries. This is necessary as we have experienced memory problems when using anything but the -MD(d) flag, and in general, it is recommended to use. You should not alter this flag yourself for your application, because it conflicts with how the Qt library is built if you change the flag to -MT. You should not change it for Qt either, since it is likely to cause problems"
More info can be found here:
http://qt-project.org/faq/answer/why_does_a_statically_built_qt_use_the_dynamic_visual_studio_runtime_librar
您应该使用这些库的 dll 版本并包含可再发行支持安装 - 由于多种原因(主要与安全更新有关),这是微软首选的方式
我的猜测是,即使使用 -static Qt 也会使用一些使用dll(可能是 webkit 或使用 MS 功能的多媒体类)
You are supposed to use the dll versions of these libraries and include the redistributable support install - it's the microsoft prefered way for several reasons (mostly to do with security updates)
My guess is that even with -static Qt uses some runtime component that uses the dll (possibly webkit or the multimedia classes that use MS features)