Search code examples
c++visual-studiovisual-studio-2017

Visual Studio 2017 failed to locate cl.exe


I recently installed Visual Studio 2017 and need to change something in a C++ project.

But when I try to build, it says cl.exe is missing. None of the solutions provided online seem to work.

I do have a cl.exe, but it is located under this path:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64

I have also tried running vcvars32.bat, but that does not seem to make any changes.

And I have installed 'Desktop development with C++'.


Solution

  • I solved it by running vcvars.bat.

    For Visual Studio Enterprise 2017 it is located under the following directory:

    C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\vsdevcmd\ext