Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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++'.

like image 978
Joery Avatar asked Jul 20 '17 06:07

Joery


People also ask

How do I know if CL exe is installed?

You can test that you have the C++ compiler, cl.exe , installed correctly by typing 'cl' and you should see a copyright message with the version and basic usage description.

What is CL exe in Visual Studio?

cl.exe is a tool that controls the Microsoft C++ (MSVC) C and C++ compilers and linker. cl.exe can be run only on operating systems that support Microsoft Visual Studio for Windows. Note. You can start this tool only from a Visual Studio developer command prompt.

Where is Cl exe stored?

cl.exe is usually located at %VCINSTALLDIR%\bin\ . VCINSTALLDIR environment variable is not set by default, but it is being set when you open Visual Studio's Native Tools Command Prompt.


1 Answers

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

like image 53
Joery Avatar answered Sep 30 '22 15:09

Joery