如何构建QTcore4.dll而不依赖于MSVCx80.dll? [英] How to build QTcore4.dll without dependency to MSVCx80.dll?
问题描述
我在Vista和XP上面临部署问题。
我用MT静态编译我的屏幕保护程序,并运行依赖关系检查器。
结果是:
MyScreensaver.SCR需要几个DLLS,QTCORE4.DLL,但没有MSVCx80.DLL。
到目前为止这是很好的。
我的问题是QTCORE4.DLL依次,确实需要MSVCP80.DLL和MSVCR80.DLL
As结果我的应用程序不在Vista系统上运行。
我可以将QTCORE4.DLL建立静态链接到微软库(可能是Libcmt.lib?),以便我在MS CRT DLL中没有任何依赖关系?
限制:
-
我不想让用户安装MS VC可再发行组件。屏幕保护程序只有1 MB,并且嘲笑要求用户在他的电脑上进行许多更改只是为了一个屏幕保护程序。
-
我不想使用诀窍将MS CRT dll与屏幕保护程序放在同一应用程序路径中,因为屏幕保护程序安装在system32中,我想在那里安装最小可能的文件。
-
我尝试了一个完整的静态编译和链接的QT,但是这是不允许的(如果我正确理解,由LGPL),也不建议这样做: http:// www .qtsoftware.com /开发商/常见问题/为什么-确实-A-静态内置QT-使用最动态视觉工作室运行时库-DO-I-需要部署的,那些 - 与 - 我的应用程序
在各个方向尝试解决方案后,似乎最可行的一个是使用QTCore4.dll和QTGui4.dll,但将它们静态链接到MSVCRT。这样,我的程序和QT DLL都不会依赖于MSVCRT dll。
有没有解决方案?
(我是QT编程的新手)
谢谢,
Michael
您有两个选项:
-
这些依赖关系是 Microsoft Visual C ++ Runtime 库,您可以将该库部署到您的installshield和用户默认安装它,默认情况下,MSVCRT库不包括在Windows中,您必须必须在您的installshield中部署运行时库,并在您的...中复制
Qt * .dll
DLL应用程序目录。 -
使用运行时和Qt主依赖关系的
静态链接
,此选项有一个可执行文件,但要静态编译Qt,您必须具有商业使用的Qt商业许可。
I have a windows screensaver that I want to recompile using the QT libraries, so that I can make available for more platforms. I am facing problems with the deployment on Vista and XP.
I compile my screensaver statically with MT, and run the dependency checker. The results are:
MyScreensaver.SCR needs several DLLS, QTCORE4.DLL but no MSVCx80.DLLs. So far this is fine.
My problem is that QTCORE4.DLL in its turn, does need MSVCP80.DLL and MSVCR80.DLL As a result my application does not run on Vista systems.
Can I build QTCORE4.DLL to be statically linked the the microsoft libraries (maybe Libcmt.lib ?) so that I do not have any dependencies in the MS CRT DLLs?
Limitations:
I do not want to have the users install the MS VC redistributables. The screensaver is only 1 MB, and it is ridiculus to ask the user to do so many changes in his computer just for a screensaver.
I do not want to use the trick to put the MS CRT dlls in the same application path with the screensaver because screensavers are installed in system32, and I want to install the minimum possible files there.
Finally, I do prefer to produce a monolithic program, rather that a bunch of DLLs
I tried a full static compilation and link of QT, but this is not allowed (if I understood correctly, by the LGPL) and also it is not recommended according to this: http://www.qtsoftware.com/developer/faqs/why-does-a-statically-built-qt-use-the-dynamic-visual-studio-runtime-libraries-do-i-need-to-deploy-those-with-my-application
After trying for solutions in various directions, it seems the most feasible one is to use the QTCore4.dll and QTGui4.dll, but having them linked statically to MSVCRT. In this way, neither my program, nor the QT DLLs will have dependencies on MSVCRT dlls.
Is there a solution to this? ( I am new to QT programming )
Thank you, Michael
You have two options:
Those dependencies are part of Microsoft Visual C++ Runtime Library, you can deploy that library in your installshield and user silently installs it, MSVCRT library not included in Windows by default, you must deploy runtime library in your installshield and copy
Qt*.dll
DLLs in your application directory.Use
Static Linking
of Runtime and Qt main dependencies, with this option you have one executable file, but to static compile of Qt you must have Qt commercial License for commercial use.
这篇关于如何构建QTcore4.dll而不依赖于MSVCx80.dll?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!