无法运行编译器'cl'

arq*_*qam 8 c++ qt

我根据说明在Windows上安装了Qt,但是当我创建了一个Qt Widget应用程序时,我收到以下错误:

Running Windows Runtime device detection.
No winrtrunner.exe found.
Project ERROR: Cannot run compiler 'cl'. Maybe you forgot to setup the environment?
Run Code Online (Sandbox Code Playgroud)

此外,在我的Qt Creator项目目录中,除了我的.pro文件外,我看不到任何内容.

我试过这个答案,但无法得到任何结果.

在我的Qt安装文件夹中,当我打开Tools文件夹时,它只有QtCreator文件夹而没有编译器文件夹.

  • Qt安装:5.9.1
  • IDE:Qt Creator

如何解决这个错误?

arq*_*qam 4

So after lots of struggle and research I am finally able to install Qt and run the program using Qt Creator in Windows.

  • For Qt to run you need a compiler and a debugger, which is not provided by default.
  • If you just have to run a Qt-only program and the extra libraries that you will be using will compile using MinGW, then you can select MinGW as the compiler during the time of installation using online Qt installer.
  • But in most cases, we will be installing Visual Studio first. Select C++/CLI in the checkbox, as it's not selected by default.
  • 安装 Visual Studio 后,我们需要一个单独的调试器 CDB 将 Qt 与 VS 链接起来。为此,您需要卸载当前的 Windows 软件开发工具包并从此处重新安装,或者在 Windows 设置应用程序中修改安装。在安装过程中,请确保选择Debugging Tool For Windows。之前卸载的原因是,如果我们在选择新选项的情况下再次安装,它不会覆盖之前的安装。
  • 现在打开 Qt 项目。转到Tools > Options > Build & Run > Debuggers,您可以看到应该自动检测调试器。
  • 现在转到套件选项卡并选择检测到的调试器。对于编译器,选择所需的编译器,您将看到编译器不兼容的警告,但您可以在程序运行时忽略它。(不要忘记选择“应用”)。