草庐IT

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

coder 2024-06-14 原文

错误信息:

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/

有关c++ - Qt - 无法找到或加载平台插件 "windows"- 但它就在那里! - 动态构建的更多相关文章

  1. ruby - 在 Ruby 程序执行时阻止 Windows 7 PC 进入休眠状态 - 2

    我需要在客户计算机上运行Ruby应用程序。通常需要几天才能完成(复制大备份文件)。问题是如果启用sleep,它会中断应用程序。否则,计算机将持续运行数周,直到我下次访问为止。有什么方法可以防止执行期间休眠并让Windows在执行后休眠吗?欢迎任何疯狂的想法;-) 最佳答案 Here建议使用SetThreadExecutionStateWinAPI函数,使应用程序能够通知系统它正在使用中,从而防止系统在应用程序运行时进入休眠状态或关闭显示。像这样的东西:require'Win32API'ES_AWAYMODE_REQUIRED=0x0

  2. ruby-on-rails - rails : "missing partial" when calling 'render' in RSpec test - 2

    我正在尝试测试是否存在表单。我是Rails新手。我的new.html.erb_spec.rb文件的内容是:require'spec_helper'describe"messages/new.html.erb"doit"shouldrendertheform"dorender'/messages/new.html.erb'reponse.shouldhave_form_putting_to(@message)with_submit_buttonendendView本身,new.html.erb,有代码:当我运行rspec时,它失败了:1)messages/new.html.erbshou

  3. ruby-on-rails - 由于 "wkhtmltopdf",PDFKIT 显然无法正常工作 - 2

    我在从html页面生成PDF时遇到问题。我正在使用PDFkit。在安装它的过程中,我注意到我需要wkhtmltopdf。所以我也安装了它。我做了PDFkit的文档所说的一切......现在我在尝试加载PDF时遇到了这个错误。这里是错误:commandfailed:"/usr/local/bin/wkhtmltopdf""--margin-right""0.75in""--page-size""Letter""--margin-top""0.75in""--margin-bottom""0.75in""--encoding""UTF-8""--margin-left""0.75in""-

  4. ruby - 检查 "command"的输出应该包含 NilClass 的意外崩溃 - 2

    为了将Cucumber用于命令行脚本,我按照提供的说明安装了arubagem。它在我的Gemfile中,我可以验证是否安装了正确的版本并且我已经包含了require'aruba/cucumber'在'features/env.rb'中为了确保它能正常工作,我写了以下场景:@announceScenario:Testingcucumber/arubaGivenablankslateThentheoutputfrom"ls-la"shouldcontain"drw"假设事情应该失败。它确实失败了,但失败的原因是错误的:@announceScenario:Testingcucumber/ar

  5. ruby-on-rails - 无法使用 Rails 3.2 创建插件? - 2

    我对最新版本的Rails有疑问。我创建了一个新应用程序(railsnewMyProject),但我没有脚本/生成,只有脚本/rails,当我输入ruby./script/railsgeneratepluginmy_plugin"Couldnotfindgeneratorplugin.".你知道如何生成插件模板吗?没有这个命令可以创建插件吗?PS:我正在使用Rails3.2.1和ruby​​1.8.7[universal-darwin11.0] 最佳答案 随着Rails3.2.0的发布,插件生成器已经被移除。查看变更日志here.现在

  6. ruby - 无法运行 Rails 2.x 应用程序 - 2

    我尝试运行2.x应用程序。我使用rvm并为此应用程序设置其他版本的ruby​​:$rvmuseree-1.8.7-head我尝试运行服务器,然后出现很多错误:$script/serverNOTE:Gem.source_indexisdeprecated,useSpecification.Itwillberemovedonorafter2011-11-01.Gem.source_indexcalledfrom/Users/serg/rails_projects_terminal/work_proj/spohelp/config/../vendor/rails/railties/lib/r

  7. ruby-on-rails - 如何优雅地重启 thin + nginx? - 2

    我的瘦服务器配置了nginx,我的ROR应用程序正在它们上运行。在我发布代码更新时运行thinrestart会给我的应用程序带来一些停机时间。我试图弄清楚如何优雅地重启正在运行的Thin实例,但找不到好的解决方案。有没有人能做到这一点? 最佳答案 #Restartjustthethinserverdescribedbythatconfigsudothin-C/etc/thin/mysite.ymlrestartNginx将继续运行并代理请求。如果您将Nginx设置为使用多个上游服务器,例如server{listen80;server

  8. ruby - 如何在续集中重新加载表模式? - 2

    鉴于我有以下迁移:Sequel.migrationdoupdoalter_table:usersdoadd_column:is_admin,:default=>falseend#SequelrunsaDESCRIBEtablestatement,whenthemodelisloaded.#Atthispoint,itdoesnotknowthatusershaveais_adminflag.#Soitfails.@user=User.find(:email=>"admin@fancy-startup.example")@user.is_admin=true@user.save!ende

  9. ruby-on-rails - 无法在centos上安装therubyracer(V8和GCC出错) - 2

    我正在尝试在我的centos服务器上安装therubyracer,但遇到了麻烦。$geminstalltherubyracerBuildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingtherubyracer:ERROR:Failedtobuildgemnativeextension./usr/local/rvm/rubies/ruby-1.9.3-p125/bin/rubyextconf.rbcheckingformain()in-lpthread...yescheckingforv8.h...no***e

  10. ruby - 无法让 RSpec 工作—— 'require' : cannot load such file - 2

    我花了三天的时间用头撞墙,试图弄清楚为什么简单的“rake”不能通过我的规范文件。如果您遇到这种情况:任何文件夹路径中都不要有空格!。严重地。事实上,从现在开始,您命名的任何内容都没有空格。这是我的控制台输出:(在/Users/*****/Desktop/LearningRuby/learn_ruby)$rake/Users/*******/Desktop/LearningRuby/learn_ruby/00_hello/hello_spec.rb:116:in`require':cannotloadsuchfile--hello(LoadError) 最佳

随机推荐