Search code examples
c++windowsvisual-studiocl

Installed Visual Studio 2022 but 'cl' is not recognized as an internal or external command


None of my terminals on Windows 10 recognize cl 'as an internal or external command'.
I have Visual Studio 2022 installed and I've tried it on every terminal, including terminals in the Visual Studio 2022 under the Start menu.

I've tried the other solutions to Stack Overflow. I tried setting an environment variable of cl to "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\Hostx86\x86\cl.exe"
Under 'Modify' in Visual Studio 2022 I have the boxes for 'Desktop development with C++' and 'Universal Windows Platform development' checked and installed.

I know there are other answers to this question but Visual Studio 2022 seems like it make have another solution.


Solution

  • Please find in your system this path:

    C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\bin\Hostx64\x64

    and add this path in the user variable path for your user name in the edit system environment variables.

    Screendhot of the process is is given

    this will work.