Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-22549

Side-by-side toolchains from MSVC 2019 are not detected

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: Not Evaluated Not Evaluated
    • None
    • Qt Creator 4.9.1
    • None
    • Windows

      Since MSVC 2017, it is possible to install older toolchains side-by-side with the current toolchain when installing Visual studio.

      See the blog post introducing this here:
      https://devblogs.microsoft.com/cppblog/side-by-side-minor-version-msvc-toolsets-in-visual-studio-2017/

      I now installed MSVC 2019 on a fresh PC and selected the components for the v140(MSVC2015) and v141(MSVC2017) toolchains for this installation. 

      In this setup, Qt creator detects two sets of Compilers: "Microsoft Visual C++ Compiler 14.0(...)" and "Microsoft Visual C++ Compiler 16.1.29001.49(...)". Version 15.9 (which would be Visual Studio 2017, aka MSVC++ 14.16 or _MSC_VER == 1916) is not being detected.

      I can however start this toolchain from Command line as described [on this page|https://docs.microsoft.com/de-de/cpp/build/building-on-the-command-line?view=vs-2019] : 

      cd C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build
      vcvarsall.bat x86 -vcvars_ver=14.16
      

      Other things I found that might be worth mentioning here:

      • AFAIK Qt Creator uses vswhere to detect installations of Visual Studio. This tool does not seem to support detecting multiple installed toolchains within a single MSVC installation, see: https://github.com/Microsoft/vswhere/issues/151 
      • The reason why the v140 / 14.0 toolchain is detected seems to be that this toolchain is installed with an own set of vcvars*.bat scripts in a seperate location, compared to newer toolchains which are not. 

      Anyhow, my expectations would be:

      • Qt creator should automatically detect a toolchain that corresponds to vcvars_ver=14.16, because the MSVC 2017 toolchain is the one that was tested with Qt 5.12.x and that is currently supported.
      • Qt creator should offer a way to manipulate vcvarsall commandline parameters, e.g. to put in custom versions of vc_vars (there can be even more tool sets installed) or to select a different windows SDK than the auto-selected one (there's an optional winsdk_version parameter, see the link above).

       

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            kandeler Christian Kandeler
            markus.maier Markus Haberlander
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes