【Qt】Project ERROR: Cannot run compiler ‘cl’. Output: Maybe you forgot to setup the environment?
问题描述
qmake -project
Project ERROR: Cannot run compiler 'cl'. Output:
===================
===================
Maybe you forgot to setup the environment?
原因分析
编译器的路径没有被添加到系统的环境变量 Path 中,系统无法找到并运行 ‘cl’ 编译器。
解决方案
将该目录添加到系统环境变量 Path
:
D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\bin\Hostx86\x86
不同版本的 MSVC 目录位置可能不同。