gpt4 book ai didi

c++ - Qt - 无法找到或加载平台插件 "windows"- 但它就在那里! - 动态构建

转载 作者:可可西里 更新时间:2023-11-01 10:44:46 28 4
gpt4 key购买 nike

错误信息:

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 .
我使用了我们都熟悉和喜爱的 dependancy walker 应用程序 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 和 API-MS-WIN-SHCORE -SCALING-l1-1-0.dll,但它们无处可寻。类似命名的 dll 包含在 kernel.dll 和 MSVCRT.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 更改为不同的文件夹名称时,我的上网本也会产生错误。

奇怪的是,以前几个版本的应用程序,都没有出现任何问题。从那时起我添加了大量代码,但我不记得有任何代码会使用不同的库。

可能是什么问题?

最佳答案

问题不在于图书馆。问题出在代码上。 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();
}

关于c++ - Qt - 无法找到或加载平台插件 "windows"- 但它就在那里! - 动态构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30865224/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com