为什么我的QT应用程序不起作用?

为什么我的QT应用程序不起作用?

问题描述:

我在Windows 7 64位(使用msvc 2010)上使用Qt Creator构建了Qt 5应用程序. 该应用程序可以在我的计算机上完美运行,但不能在其他计算机上运行.

I built a Qt 5 application using Qt Creator on Windows 7 64 bit (using msvc 2010). The application runs perfectly on my computer but it won't work on other computers.

我将在 Dependency Walker 中显示为丢失的所有.dll复制到了程序文件夹中,没有错误,但是应用程序无法运行.

I copied all the .dlls which were shown as missing in Dependency Walker into the program folder and there is no error, but the application just won't run.

我已经在Windows XP和Windows 7 64位和32位上对其进行了测试.
我该怎么办才能找出问题所在?

I've tested it on Windows XP and Windows 7 64 and 32 bit.
What can I do in order to find out what's wrong?

更新:我安装了Qt 4.8.4(vs 2008)和msvc 2008 Express并对其进行了编译,并且它可以在其他计算机上运行,​​并带有Qt4的.dlls. 也许有人知道Qt5有什么问题...

UPDATE: i installed Qt 4.8.4 (vs 2008) and msvc 2008 express and i compiled it and it's runs on other computers, with the .dlls of Qt4. maybe someone know what the problem with Qt5...

我遇到了同样的问题.

您需要在可执行目录中包括包含qwindows.dll和qminimal.dll的平台"目录.您可以在插件"文件夹下找到该目录.

You need to include the "platform" directory containing qwindows.dll and qminimal.dll in your executable directory. You can find the directory under the "plugins" folder.

如果不添加它,您的应用程序将显示为正在加载,然后退出,返回码为0.依赖项遍历无法为您提供帮助,因为DLL是延迟加载的.

If you don't add this, your application will appear to load and then exit with return code 0. Dependency walker cant help you because the DLLs are delay-loaded.