title: QtCreator qmake Cannot run compiler 'cl'
body: <p>Just configured new windows environment with MSVS 2017 and Qt5.9.1.<br />
  While building example project <code>bars</code> met an error</p>
  <pre><code>Project ERROR: Cannot run compiler 'cl'. Maybe you forgot to setup the environment?
  </code></pre>
  <p>With mingw build and run fine.</p>
  <hr />
  <p>I tried to add <em>Custom build step</em> before <strong>qmake</strong></p>
  <pre><code>&quot;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat&quot; amd64
  </code></pre>
  <p>But got the same results. In <code>cmd</code> this command works fine. After it <code>cl.exe</code> is reachable.</p>
  <hr />
  <p>All toolsets was found automatically by Qt and seems to be right</p>
  <p><sub><em>here were screenshots</em></sub>
  <img src="https://image.prntscr.com/image/42ZjeJlRQrWYdMMybs789A.png" alt="" />
  <img src="https://image.prntscr.com/image/IXkGHMWAQgKBc6vbnIY0Bg.png" alt="" /></p>
  <hr />
  <h3>Update1. Build in Developer Command Prompt for VS 2017</h3>
  <pre><code>**********************************************************************
  ** Visual Studio 2017 Developer Command Prompt v15.0.26730.16
  ** Copyright (c) 2017 Microsoft Corporation
  **********************************************************************
  
  C:\Users\Admin\source&gt;&quot;C:\Devel\Qt\Qt5.9.1\5.9.1\msvc2017_64\bin\qmake.exe&quot; C:\Devel\Qt\Qt5.9.1\Examples\Qt-5.9.1\datavisualization\bars\bars.pro -spec win32-msvc
  
  C:\Users\Admin\source&gt;nmake
  
  Microsoft (R) Program Maintenance Utility Version 14.11.25508.2
  Copyright (C) Microsoft Corporation.  All rights reserved.
  
          &quot;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.11.25503\bin\HostX86\x86\nmake.exe&quot; -f Makefile.Release
  
  Microsoft (R) Program Maintenance Utility Version 14.11.25508.2
  Copyright (C) Microsoft Corporation.  All rights reserved.
  
          cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -O2 -MD -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc -DUNICODE -DWIN32 -DQT_NO_DEBUG -DQT_DATAVISUALIZATION_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -I..\..\..\Devel\Qt\Qt5.9.1\Examples\Qt-5.9.1\datavisualization\bars -I. -I../../../include -I..\..\..\Devel\Qt\Qt5.9.1\5.9.1\msvc2017_64\include -I..\..\..\Devel\Qt\Qt5.9.1\5.9.1\msvc2017_64\include\QtDataVisualization -I..\..\..\Devel\Qt\Qt5.9.1\5.9.1\msvc2017_64\include\QtWidgets -I..\..\..\Devel\Qt\Qt5.9.1\5.9.1\msvc2017_64\include\QtGui -I..\..\..\Devel\Qt\Qt5.9.1\5.9.1\msvc2017_64\include\QtANGLE -I..\..\..\Devel\Qt\Qt5.9.1\5.9.1\msvc2017_64\include\QtCore -Irelease -I..\..\..\Devel\Qt\Qt5.9.1\5.9.1\msvc2017_64\mkspecs\win32-msvc -Forelease\ @C:\Users\Admin\AppData\Local\Temp\nm6ED7.tmp
  main.cpp
  graphmodifier.cpp
  Generating Code...
          cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -O2 -MD -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc -DUNICODE -DWIN32 -DQT_NO_DEBUG -DQT_DATAVISUALIZATION_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -I..\..\..\Devel\Qt\Qt5.9.1\Examples\Qt-5.9.1\datavisualization\bars -I. -I../../../include -I..\..\..\Devel\Qt\Qt5.9.1\5.9.1\msvc2017_64\include -I..\..\..\Devel\Qt\Qt5.9.1\5.9.1\msvc2017_64\include\QtDataVisualization -I..\..\..\Devel\Qt\Qt5.9.1\5.9.1\msvc2017_64\include\QtWidgets -I..\..\..\Devel\Qt\Qt5.9.1\5.9.1\msvc2017_64\include\QtGui -I..\..\..\Devel\Qt\Qt5.9.1\5.9.1\msvc2017_64\include\QtANGLE -I..\..\..\Devel\Qt\Qt5.9.1\5.9.1\msvc2017_64\include\QtCore -Irelease -I..\..\..\Devel\Qt\Qt5.9.1\5.9.1\msvc2017_64\mkspecs\win32-msvc -Forelease\ @C:\Users\Admin\AppData\Local\Temp\nm7EF5.tmp
  moc_graphmodifier.cpp
          link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:WINDOWS &quot;/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'&quot; /MANIFEST:embed /OUT:release\bars.exe @C:\Users\Admin\AppData\Local\Temp\nm8417.tmp
  Qt5DataVisualization.lib(Qt5DataVisualization.dll) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'x86'
  NMAKE : fatal error U1077: '&quot;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.11.25503\bin\HostX86\x86\link.EXE&quot;' : return code '0x458'
  Stop.
  NMAKE : fatal error U1077: '&quot;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.11.25503\bin\HostX86\x86\nmake.exe&quot;' : return code '0x2'
  Stop.
  
  C:\Users\Admin\source&gt;
  </code></pre>
  <p>Linkage errors. <strong>But <code>cl.exe</code> found.</strong></p>