Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Configuring VC2022 compiler in Qt Creator - _MSC_VER not set
Forum Updated to NodeBB v4.3 + New Features

Configuring VC2022 compiler in Qt Creator - _MSC_VER not set

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
4 Posts 2 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Asperamanca
    wrote on 27 Jan 2023, 09:47 last edited by Asperamanca
    #1

    I'd like to compile my Qt 6 projects with MSVC2022 compiler. Qt Creator didn't auto-detect the compiler, so I added it manually.
    I copied the entries from MSVC2019 (4 entries for C, 4 for C++), gave them new names (e.g. "Microsoft Visual C++ Compiler 19.34.31937 (amd64)"), specified the correct path to vcvarsall.bat. ABI was then auto-detected, and I specified the subtype ("amd64" in this case).
    No red or yellow flags showed, so I thought I was good.

    I then created a new Kit for Qt 6.4.2 using these compilers (same setting as the auto-generated kit for 6.4.2 using MSVC2019, just replacing the compilers and making sure the qmake path was correct).

    Then I switched my (cmake) project to the new kit, by deleting the .user file setting it up anew.
    And got the following error when trying to rebuild:

    Unexpected compiler version, expected MSVC 19.34 or newer.
    

    From my understanding, this information should be set from vcvarsall.bat as specified in the compiler setup.
    What could have gone wrong?

    EDIT: Correction: There is an auto-detected version of the MSVC2022 compiler (although the version number doesn't match what cl.exe outputs, but version numbers for MSVC are a topic on their own).
    Regardless, I tries using the auto-detected compiler in my Qt kit, but the error is the same.

    A 1 Reply Last reply 27 Jan 2023, 13:26
    0
    • A Asperamanca
      27 Jan 2023, 09:47

      I'd like to compile my Qt 6 projects with MSVC2022 compiler. Qt Creator didn't auto-detect the compiler, so I added it manually.
      I copied the entries from MSVC2019 (4 entries for C, 4 for C++), gave them new names (e.g. "Microsoft Visual C++ Compiler 19.34.31937 (amd64)"), specified the correct path to vcvarsall.bat. ABI was then auto-detected, and I specified the subtype ("amd64" in this case).
      No red or yellow flags showed, so I thought I was good.

      I then created a new Kit for Qt 6.4.2 using these compilers (same setting as the auto-generated kit for 6.4.2 using MSVC2019, just replacing the compilers and making sure the qmake path was correct).

      Then I switched my (cmake) project to the new kit, by deleting the .user file setting it up anew.
      And got the following error when trying to rebuild:

      Unexpected compiler version, expected MSVC 19.34 or newer.
      

      From my understanding, this information should be set from vcvarsall.bat as specified in the compiler setup.
      What could have gone wrong?

      EDIT: Correction: There is an auto-detected version of the MSVC2022 compiler (although the version number doesn't match what cl.exe outputs, but version numbers for MSVC are a topic on their own).
      Regardless, I tries using the auto-detected compiler in my Qt kit, but the error is the same.

      A Offline
      A Offline
      Asperamanca
      wrote on 27 Jan 2023, 13:26 last edited by
      #2

      @Asperamanca
      So....using an existing build folder from a different kit, and expecting "Clean" to handle it is not a good idea.
      Either use a different build folder, or manually delete all content.

      1 Reply Last reply
      0
      • O Offline
        O Offline
        ortiz47
        wrote on 21 Apr 2023, 19:34 last edited by
        #3

        @Asperamanca have you solved the issue?

        A 1 Reply Last reply 24 Apr 2023, 08:09
        0
        • O ortiz47
          21 Apr 2023, 19:34

          @Asperamanca have you solved the issue?

          A Offline
          A Offline
          Asperamanca
          wrote on 24 Apr 2023, 08:09 last edited by
          #4

          @ortiz47
          Yes, by completely cleaning the contents of the build folder. "Clean project" is not enough.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved