c++ - 使用 Qt 5.2 静态库编译时在 Windows 上加载 Qt 应用程序时出错

标签 c++ qt qt5

我已经成功地将 Qt 5.2 构建为 static 但是,一旦我使用该库运行应用程序,我就会收到以下运行时错误:

This application failed to start because it could not find or load the Qt platform plugin "windows".

我想知道是否有办法避免DLL 依赖 以拥有独立的.exe 文件。非常感谢。

最佳答案

在您的应用程序文件夹中创建一个名为“platforms”的文件夹,并将 qwindows.dll 放入其中。 这将解决问题。

您可以使用 QT 源代码。 http://qt-project.org/doc/qt-5.0/qtdoc/deployment-windows.html :)

关于c++ - 使用 Qt 5.2 静态库编译时在 Windows 上加载 Qt 应用程序时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20676935/

相关文章:

python - 相对于父窗口居中 Qt 子窗口

c++ - Qt5自定义LineEdit小部件(QLineEdit子类)私有(private)变量崩溃应用

c++ - Qt-如何在拖动项目时显示图像/图标/数据?

python - PyImport_Import 失败 - 返回 NULL

c# - 像在 c# 中一样将整个类作为参数传递给线程 c++

c++ - 如何获得避免滚动条的 TreeView 控件的最小尺寸?

multithreading - 如何通过 QSqlQueryModel 进行异步查询?

c++ - 在 Mac OS X 上使用 LLVM 安装和编译

Python OpenCV 错误 : Current thread is not the object's thread

c++ - QT FontMetrics::BoundingRect 大小错误