Qt5 静态构建产生无法加载平台插件“windows"

Qt5 Static Build yields Failed to load platform plugin quot;windowsquot;(Qt5 静态构建产生无法加载平台插件“windows)
本文介绍了Qt5 静态构建产生无法加载平台插件“windows"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Visual Studio 2012 在 Windows 上编写 Qt 应用程序.使用 Qt 插件和 Qt 5.0.2 的自定义构建的静态 分发版.每当我运行应用程序时,我都会遇到可怕的 无法加载平台插件窗口" 错误.我在链接器输入中添加了以下内容:

I am writing a Qt application on Windows using Visual Studio 2012. Using the Qt Add-in and a custom built static distribution of Qt 5.0.2. I am running into the dreaded "Failed to load platform plugin windows" error whenever I run the application. I have added the following to the linker input:

imm32.lib
winmm.lib
Ws2_32.lib
qtmaind.lib
Qt5Cored.lib
Qt5Guid.lib
Qt5Widgetsd.lib

起初我想也许我应该将qwindowsd.lib"也添加到该列表中,但这并没有解决问题.我需要做什么才能使我的应用程序运行?

At first I thought that maybe I should add "qwindowsd.lib" to that list as well however that did not fix the problem. What do I need to do in order to make my application run?

推荐答案

我解决了.多亏了这个,我才能让一切正常工作.我添加了以下库:

I solved it. Thanks to this I was able to get everything to work. I added the following libraries:

opengl32.lib
Qt5PlatformSupport.lib
qwindows.lib

我还在我的代码中添加了以下内容:

I also added the following to my code:

#include <QtPlugin>
Q_IMPORT_PLUGIN (QWindowsIntegrationPlugin);

这篇关于Qt5 静态构建产生无法加载平台插件“windows"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Rising edge interrupt triggering multiple times on STM32 Nucleo(在STM32 Nucleo上多次触发上升沿中断)
How to use va_list correctly in a sequence of wrapper functions calls?(如何在一系列包装函数调用中正确使用 va_list?)
OpenGL Perspective Projection Clipping Polygon with Vertex Outside Frustum = Wrong texture mapping?(OpenGL透视投影裁剪多边形,顶点在视锥外=错误的纹理映射?)
How does one properly deserialize a byte array back into an object in C++?(如何正确地将字节数组反序列化回 C++ 中的对象?)
What free tiniest flash file system could you advice for embedded system?(您可以为嵌入式系统推荐什么免费的最小闪存文件系统?)
Volatile member variables vs. volatile object?(易失性成员变量与易失性对象?)