the macro '_MSC_VER': value mismatch the PlatformToolset seleced in visual studio 2022

Frank Young 20 Reputation points
2023-11-17T08:15:05.9866667+00:00

I am using Visual Studio 2022, and I installed follow Platform Toolset:

v143 (Visual Studio 2022) , v142 (Visual Studio 2019)

The value of '_MSC_VER' in the c++ code never change enven if I switch from the two toolsets.

It keeps '_MSC_VER= 1938'.

But in QtCreator, add these toolsets to kits and config them as the build tools of the porject. Then when I switch from the two toolsets, '_MSC_VER' in code has the correct value , like:

when use v143 '_MSC_VER= 1938'

when use v143 '_MSC_VER= 1929'

So why the macro '_MSC_VER': value mismatch the PlatformToolset seleced in visual studio 2022 ?

quote: maybe the same in 2019 and 2017.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,277 questions
{count} votes

Accepted answer
  1. RLWA32 46,111 Reputation points
    2023-11-17T10:21:27.4433333+00:00

    I could not reproduce your issue with VS2022 Community 17.8.0

    Macro values building with v143 toolset (VS2022) -

    V143

    Macro values building with v142 toolset (VS2019( -

    V142


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.