【问题标题】:Qt - Could not find or load platform plugin "windows" - but it's right there! - dynamic buildQt - 无法找到或加载平台插件“windows” - 但它就在那里! - 动态构建
【发布时间】:2015-06-16 10:38:42
【问题描述】:

错误信息:

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

Reinstalling the application may fix the problem.

我进行了大量搜索,但没有找到任何解决方案。

我已经关注了这个"Deploy an App on Windows - 即使是快速而肮脏的方法也失败了。
我有/platforms/qwindows.dll in my app root directory
我使用了我们都知道和喜爱的依赖行者应用程序depend.exe

Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

坦率地说,我不明白这个……语言障碍?它说缺少 DLL,DCOMP.dllAPI-MS-WIN-APPMODEL-RUNTIME-L1-1-0-.dllAPI-MS-WIN-CORE-WINRT -ERROR-L1-1-0, -L1-1-0, -ROBUFFER-L1-1-0, -STRING-L1-1-0.DLL and API-MS-WIN-SHCORE-SCALING-l1-1-0.dll,但找不到它们。 kernel.dll 和 MSVCRT.dll 中包含类似命名的 dll。它还提到了IESHIMS.dll,但包括它并没有什么区别。

我的文件夹中有以下 dll:

  • /platforms/qwindows.dll
  • icuin53.dll
  • icudt53.dll
  • icuuc53.dll
  • libEGL.dll(即使我的应用不使用它)
  • libgcc_s_dw2-1.dll
  • libopencv_core2410.dll
  • libopencv_highgui2410.dll
  • libopencv_imgproc2410.dll
  • libstdc++-6.dll
  • IEShims.dll
  • libwinpthread-1.dll
  • Qt5Core.dll
  • Qt5Gui.dll
  • Qt5Widgets.dll

复制自C:\Qt\5.4.0\5.4\mingw491_32

exe 的调试版本有一个相同的问题,它带有 *d.dll 库。

我在 Windows 7 64 位上使用 Qt 5.4.0 和 Mingw32 4.9.1。

该应用程序显然可以在我的上网本上编译和运行,每台其他 PC 都会给我错误,但是我必须分发它。当我将 C:\Qt 更改为不同的文件夹名称时,我的上网本也会产生错误。

奇怪的是,应用程序的早期版本很少,没有任何问题。从那时起,我添加了大量代码,但我不记得有什么会使用不同的库。

可能是什么问题?

【问题讨论】:

  • 请表示一些类型或消息错误
  • @t3ft3l--我在标题中。我将添加完整的消息,但我暂时使用的是 1ghz 上网本,因此可能需要一段时间...
  • 如果你在调试中运行,你可能需要 qwindowsd.dll
  • @GPPK 这是 exe 的发布版本。此外,我创建了第二个目录,其中包含调试版本和 *d.dll 库

标签: c++ windows qt dll


【解决方案1】:

问题不在于库。问题出在代码上。 main.cpp 中缺少一行,默认情况下不包含该行,但应该是 main() 函数的第一行。

QCoreApplication::addLibraryPath("./");

int main(int argc, char *argv[])
{
    QCoreApplication::addLibraryPath("./"); //this goddamn line right here
    QApplication a(argc, argv);
    MainWindow w;
    w.show();

    return a.exec();
}

【讨论】:

  • 如果你也可以把它放到资源文件的/etc/qt.conf中。
猜你喜欢
  • 2017-03-01
  • 2016-11-16
  • 2016-01-08
  • 1970-01-01
  • 2018-06-08
  • 2018-05-08
  • 2014-04-11
  • 1970-01-01
  • 2020-04-13
相关资源
最近更新 更多