qt+vs2017 uses vs2015 to compile an error 'type_traits': No such file or directory

qt + vs2017 under Win7 uses vs2015 to compile an error

  • 'type_traits': No such file or directory
  • 'cl' is not recognized as an internal or external command, operable program or batch file

The cause of the problem: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.batthere are two lines of check commands in , and the failure of the check commands leads to the failure of calling this batch process to initialize the vc environment when qt is compiled, and then reports an error. You can refer to the link modificationvcvarsall.bat

Reference: https://blog.csdn.net/weixin_33890526/article/details/85856500

That is, comment out the two lines

REM if exist "%~dp0..\common7\IDE\devenv.exe" goto setup_VS
REM if not exist "%~dp0..\common7\IDE\wdexpress.exe" goto setup_buildsku

Note that the environment variable VCTargetPathis generally not required to be set. If you have installed individual nodejs modules before, you need to add VCTargePathenvironment variables when compiling, and you must delete them after upgrading to VS2017 or VS2019. VCTargePathOtherwise, it will cause problems in compiling VC projects with VS2017 or VS2019.


VS140COMNTOOLSIn addition, you need to confirm whether the system environment variable (corresponding to VS2015) has been added correctly, (corresponding to VS2013 VS130COMNTOOLS)

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\

If the above solutions are still not working after trying, you need to confirm whether the Windows SDK is followed and whether it is added to the system environment variable ( Path)

For example (x86):

  • Windows SDK 8.1
C:\Program Files (x86)\Windows Kits\8.1\bin\x86;
  • Windows SDK 10 xxxx.xxxx
C:\Program Files (x86)\Windows Kits\xxxx.xxxx\bin\x86;

Guess you like

Origin blog.csdn.net/yqq1997/article/details/103454253