c++ - Qt 5.1 应用程序无法在 QtCreator 之外的 Windows 8 上运行,运行时错误

标签 c++ qt runtime-error

我用 Qt 5.1/C++ 编写了一个非常简单的应用程序。我在 Windows 7 64 位上编写的。我将 QtCreator 构建的 *.exe 文件粘贴到新创建的文件夹中,并在其中添加了一些 *.dll。

所以我的文件夹的内容如下所示:

myapp.exe
icudt51.dll
icuin51.dll
icuuc51.dll
libgcc_s_dw2-1.dll
libstdc++-6.dll
libwinpthread-1.dll
Qt5Core.dll
Qt5Gui.dll
Qt5Widgets.dll

这一切都可以在我的电脑上运行。但是,我将其发送给我的 friend 在他的 Windws 8 64 位上进行测试,他得到了这样的错误:

enter image description here

我还应该做什么才能让我的 Windows 8 friend 可以运行我的应用程序?

在我的计算机上,dependecy walker 说,我需要这些 dll:

enter image description here

不幸的是,在 Windows XP 上仍然不起作用:

enter image description here enter image description here

好的,终于成功了!

enter image description here

qwindows.dll 需要位于名为platforms 的目录中。

最佳答案

创建文件夹<your-app-dir>/platforms并复制文件 qwindows.dll、qminimal.dll,也许还有 libEGL.dll。

请参阅此处的文档:

另外:

关于c++ - Qt 5.1 应用程序无法在 QtCreator 之外的 Windows 8 上运行,运行时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18331050/

相关文章:

c++ - 如果派生类具有私有(private)变量,则派生类数组不起作用

c++ - 如何从 std::string 中删除重复字符

c++ - 检查指针是否指向特定类 C++

c++ - 是否有任何计划或现有项目将 OpenGL API 移植到 C++?

opencv - opencv2 HOG代码中的运行时错误SIGSEV

qt - Qt Creator:从资源中读取图像

c++ - Qt GraphicsView 拉伸(stretch)场景以适应

qt - 如何知道哪个 QObject::connect 失败

node.js - Node-horseman 未处理的拒绝评估

python - Flask 运行时出现问题