[c++] 'cl' is not recognized as an internal or external command,

I am trying to compile a hello world program in Qt Using Qt Creator.

I am getting 'cl' is not recognized as an internal or external command.

I am using Windows 7 and Both Vs 2008 and 2010 installed in it. When I use Mingw it is compiling fine but if use vs 2008 it is giving this error.

After Setting Env Path =..;..;C:\Program Files\Microsoft Visual Studio 9.0\VC\bin also it is showing the same error.

This question is related to c++ qt

The answer is


You can use Command prompt for VS 2010 and then select the path that your boost located. Use "bootstrap.bat", you can successfully install it.


I had the same problem. Try to make a bat-file to start the Qt Creator. Add something like this to the bat-file:

call "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat"  
"C:\QTsdk\qtcreator\bin\qtcreator" 

Now I can compile and get:

jom 1.0.8 - empower your cores
11:10:08: The process "C:\QTsdk\qtcreator\bin\jom.exe" exited normally.

You will have to set environmental variables properly for each compiler. There are commands on your Program menu for each compiler that does that, while opening a command prompt.

Another option is of course to use the IDE for building your application.


I had the same problem and I solved it by switching to MinGW from MSVC2010.

Select the Project Tab from your left pane. Then select the "Target". From there change Qt version to MinGW instead of VC++.


I had this problem because I forgot to select "Visual C++" when I was installing Visual Studio.

To add it, see: https://stackoverflow.com/a/31568246/1054322


For me, this was related to the scenario described by Smi, with the difference being that vcvarsall.bat itself was failing due to an invalid path.

This was cause by line-breaks within the path, which meant vcvarsall.bat couldn't find the common tools directory for some reason.


Make sure you restart your computer after you install the Build Tools.

This was what was causing the error for me.


I had the same issue for a long time and I spent God knows how much on it until I accidentally figured what to do. This solution worked on windows 10. All you need to do is to add C:\WINDOWS\System32 to Path variable under User Variables in Environmental Variables... Note that if you add this to the system variables, it may also work. But, that didn't work for me.


I sometimes get this problem when changing from Debug to Release or vice-versa. Closing and reopening QtCreator and building again solves the problem for me.

Qt Creator 2.8.1; Qt 5.1.1 (MSVC2010, 32bit)