在visual studio中调试Qt,缺少msvcp140d_app.dll [英] Debugging Qt in visual studio, msvcp140d_app.dll is missing

查看:63
本文介绍了在visual studio中调试Qt,缺少msvcp140d_app.dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Qt 的新手,但几年来我一直在使用 Visual Studio 进行 C/C++ 开发.现在我正在尝试为我的项目构建一个 GUI.我在我的工作计算机和家用 PC 上安装了 Qt 5.11.0Qt VS Tools.在工作中,我可以使用 VS 调试器构建和运行我的项目,但是在我的家庭系统上,我可以构建但无法使用 VS 调试器运行或仅启动应用程序.我试过发布,它运行良好.

I'm new to Qt, but have been working with Visual studio for C/C++ development for a few years. Now I'm trying to build a GUI for my project. I installed Qt 5.11.0 and the Qt VS Tools on both my work computer and home PC. At work I can build and run my project with the VS debugger, however on my home system I can build but can't run either with VS debugger or simply launching the app. I tried in release and it runs fine.

我得到的 error 是:

无法继续执行代码,因为找不到 VCRUNTIME140D_APP.dll.

The code execution cannot proceed because VCRUNTIME140D_APP.dll was not found.

我得到 4 个,前两个需要 VCRUNTIME,后两个需要 MSVCP140D_APP.dll.

I get 4 of these, the first two want VCRUNTIME, the second two want MSVCP140D_APP.dll.

到目前为止我尝试过的解决方案:

Solutions I've tried so far :

  1. 卸载 Win SDK 并重新安装
  2. 卸载 VS2017 和 SDK 并重新安装
  3. 搜索 System32、SysWOW64 和 VS 安装目录 - 找到 msvcp140d.dllvcruntime140d.dll,但没有找到 _app.dlls
  1. Uninstalled Win SDK and reinstalled
  2. Uninstalled VS2017 and SDK and reinstalled
  3. Searched System32, SysWOW64 and VS install directories - found msvcp140d.dll and vcruntime140d.dll, but no _app.dlls

有谁知道这些包含什么以及从哪里获得它们?我不明白为什么我的工作电脑上有它们,但家里没有.我在两个系统上都有相同的 VS 更新、相同的 Qt 版本和 SDK.

Does anyone know what these are included with and where to get them? I can't figure out why I have them on my work computer but not at home. I have the same VS updates, same Qt version, and SDK on both systems.

使用:

  • Visual Studio 2017 v15.7.1
  • Qt 5.11.0 - msvc2017_64

我想我可以从我的工作电脑上复制 .dll's 并将它们放在另一台电脑的适当位置,但我想知道它们应该安装什么,所以我可以在两个系统上使用相同的设置.

I suppose I can just copy the .dll's from my work pc and drop them in the appropriate locations on the other, but I'd like to know what they should have been installed with so I can have the same setup on both systems.

我还尝试使用 Qt 版本 msvc2015_64 和 winrt_x64_msvc2015 将平台工具集更改为 VS2015

I also tried changing the platform toolset to VS2015 with Qt versions msvc2015_64 and winrt_x64_msvc2015

我发现了这篇关于同样缺失的帖子 _app.dll 文件.那里没有任何答案,这就是为什么我尝试重新安装 SDK,希望其中包含丢失的文件.

I found this post concerning the same missing _app.dll files. There wasn't any answer there, which is why I tried reinstalling the SDK in the hope the missing files were included there.

我刚刚在工作时扫描了我的整个系统,结果发现我也没有丢失的 .dll .这告诉我两者之间的项目属性或配置存在差异.我使用 git 进行源代码控制,并且我目前是该项目的唯一贡献者.当我尝试构建和运行入门指南中的示例时,我在家里遇到了同样的问题,缺少 _app.dll 文件,但它在工作中运行良好.我现在很困惑,非常感谢任何提示.

Edit 2: I just scanned my entire system at work and it turns out that I don't have the missing .dll there either. That tells me that there is a difference in the project properties or configuration between the two. I use git for source control, and I am currently the only contributor to this project. When I try to build and run just the example from the getting started guide I have the same problem at home with missing _app.dll files, however it works fine at work. I'm totally confused now, and any hints are greatly appreciated.

推荐答案

解决方案:

在尝试了几个小时制作新的解决方案等之后.我决定删除整个构建文件夹并将所有依赖项的新副本放入其中.我的项目现在在调试模式下运行良好.

After trying for a couple of hours making new solutions etc. I decided to delete the entire build folder and put fresh copies of all the dependencies into it. My project now runs fine in debugging mode.

我相当肯定,当我最初将 Qt .dll 文件复制到其中时,我一定是从 winrt 文件夹之一而不是 msvc2017_64 文件夹中抓取了它们.为了测试,我用 winrt_x64_msvc2017 文件夹中的文件替换了工作中的 .dll 文件,果然再次出现相同的错误.所以,这对我来说是一个愚蠢的错误,但希望它会在未来为其他人节省很多麻烦.

I'm fairly certain that when I originally copied the Qt .dll files into it I must have grabbed them from one of the winrt folders rather than the msvc2017_64 folder. To test I replaced the working .dll files with those from the winrt_x64_msvc2017 folder and sure enough the same errors again. So, this was a dumb mistake on my part, but hopefully it'll save someone else a lot of hair-pulling in the future.

这篇关于在visual studio中调试Qt,缺少msvcp140d_app.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆