【解决】Qt Creator只显示.pro文件 / Cannot run compiler 'cl'.
问题:在Qt Creator创建项目时,成功创建了项目,但QtCreator只显示.pro文件,并且无法构建。
编译输出:
Project ERROR: Cannot run compiler 'cl'. Output:
=================== ===================
Maybe you forgot to setup the environment?
15:00:43: The command "D:\Software\Qt\5.15.2\msvc2019_64\bin\qmake.exe D:\code\QtProjects\untitled2\untitled2.pro -spec win32-msvc "CONFIG+=debug" "CONFIG+=qml_debug"" terminated with exit code 3.
15:00:43: Error while building/deploying project untitled2 (kit: Desktop Qt 5.15.2 MSVC2019 64bit)
15:00:43: When executing step "qmake" Issue: :-1: error: Cannot run compiler 'cl'. Output:
版本信息: Qt 5.12.5, Qt Creator 17.0.0, Windows 11, 编译器MSVC2019_64bit
尝试过但无用的方法:重装Qt、Qt Creator、VS2019、配置cl.exe的环境变量……
解决方法:
MSVC 编译器需要特殊的环境变量(如INCLUDE等),这些变量通常由 VS 的命令行工具自动配置。

浙公网安备 33010602011771号