win 7 x64 上的 32 位 Qt 应用程序无法运行,但在 Qt Creator 中运行良好? [英] 32-bit Qt application on win 7 x64 won't run, but runs fine from Qt Creator?

查看:120
本文介绍了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 提示符运行)时,我得到:

<前>---------------------------RenameTemplatePreviewFiles_Qt_win.exe - 应用程序错误---------------------------应用程序无法正确启动 (0xc000007b).单击确定关闭应用程序.---------------------------好的---------------------------

如果我将配置切换到 64 位 Qt 并构建它,我可以双击 exe 并且它运行良好.

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

解决方案

我有点受过教育的猜测是您的应用程序根本找不到所需的 DLL.当然,您可以在 Dependency Walker 中打开您的 exe,看看它是否找到了所有必需的 DLL.如果一开始看起来没有任何问题,那么使用 Dependency Walker 来分析应用程序.这可能会揭示一些在运行时加载的缺失依赖项.

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

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   
---------------------------

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

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

解决方案

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.

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天全站免登陆