Win 7 x64上的32位Qt应用程序无法运行,但可以从Qt Creator中正常运行吗? [英] 32-bit Qt application on win 7 x64 won't run, but runs fine from Qt Creator?

查看:742
本文介绍了Win 7 x64上的32位Qt应用程序无法运行,但可以从Qt Creator中正常运行吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的开发箱是Windows 7 x64。我的机器上同时装有32位和64位的Qt 4.7.4版本。当我将我的应用程序配置为使用32位版本的Qt时,它在Qt Creator(ctrl-R)中运行良好,但是当我尝试在Windows资源管理器中双击exe时(或从cmd提示符运行), :

My development box is Windows 7 x64. I have both 32-bit and 64-bit versions of Qt 4.7.4 built on my box. When I configure my app to use the 32-bit version of Qt, it runs fine in Qt Creator (ctrl-R), but when I try to double-click the exe in Windows Explorer (or run from cmd prompt), I get:


---------------------------
RenameTemplatePreviewFiles_Qt_win.exe - Application Error
---------------------------
The application was unable to start correctly (0xc000007b). 
Click OK to close the application. 
---------------------------
OK   
---------------------------

如果我将配置切换到64位Qt并构建它,我可以双击该exe,它可以正常运行。

If I switch my configuration to 64-bit Qt and build it, I can double-click the exe and it runs fine.

我需要做什么才能运行使用32位Qt编译的exe?

What do I need to do to be able to run the exe compiled with 32-bit Qt?

推荐答案

我有点受过教育的猜测是,您的应用程序根本找不到所需的DLL。可以肯定的是,您可以在 Dependency Walker 中打开exe,以查看是否找到了所有必需的DLL。如果一开始似乎没有什么不对,请使用Dependency Walker来分析应用程序。

My somewhat educated guess would be that your application can simply not find the required DLLs. To be sure, you could open your exe in Dependency Walker to see if it finds all the necessary DLLs. If nothing seems amiss at first, then use Dependency Walker to profile the application. This might reveal some missing dependencies loaded at run-time.

如果这与您的Qt DLL有关,请确保PATH环境变量中有适当的条目,或所需的DLL包含在EXE的目录中(尽管后者可能不是开发计算机上的最佳选择)。

If this relates to your Qt DLLs, make sure that there is either an appropriate entry within your PATH environment variable, or that the required DLLs are included in your EXE's directory (though the latter might not be the best choice on a development machine).

这篇关于Win 7 x64上的32位Qt应用程序无法运行,但可以从Qt Creator中正常运行吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆