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. Qt Creator cannot set up MSVC2019 compiler successfully.
Forum Updated to NodeBB v4.3 + New Features

Qt Creator cannot set up MSVC2019 compiler successfully.

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
4 Posts 3 Posters 578 Views 2 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.
  • C Offline
    C Offline
    chenke404
    wrote on last edited by
    #1

    I have installed VS2022 with vc143(MSVC2022() and vc142(MSVC2019).
    I can normally work in VS using different MSVC versions.
    Since I prefer Qt Creator's cmake project feature, I want to work in Qt Creator using vc142.

    abeef7b4-5eb5-4af7-bacd-89508131b1c3-image.png
    [P1] Compiler directory

    Then I have set up vc142 compiler:
    0ebd8abe-9a6c-41fc-9c81-ffb9c92aeb9b-image.png
    [P2] The C compiler

    ca535a56-bba2-4c77-a963-c840d35ef167-image.png
    [P3] The C++ compiler

    d9fb1e2b-5df9-4798-bcfb-88fc3154aecd-image.png
    [P4] The kit

    475e4166-294c-4688-b36e-d277c34e47c1-image.png
    [P5]Use the MSVC2019 kit and configure project

    The problem is that I got vc143 but I configured vc142, just like the red underline in [P5] shows

    294c0ff6-3294-4d43-ae11-c4e49be1edb7-image.png
    [P5] If I set up an MSVC2017 kit that compiler does not exist, IDE will tip me that compiler is not exists.

    23c88cfe-ae2a-4d30-a802-78ca19ee4cf8-image.png
    [P6] Always got vc143

    I guess the reason is vcvarsal.bat, I try to run vcvarsall.bat by myself...

    a1c40b56-2426-4e60-831b-4eef511b7dfb-image.png
    [P7] Run it in MinGW and PowerShell have no effect anyway

    31585bd3-51b8-4934-8882-5b9c52d10e49-image.png
    [P8] Run it in CMD all is well, then i can use vc142 in this cmd session normaly(such as build boost using vc142).

    I don't know why and I don't know how, but I hope somebody can fix this.

    1 Reply Last reply
    0
    • cristian-adamC Offline
      cristian-adamC Offline
      cristian-adam
      wrote on last edited by
      #3

      It is possible to achieve this, but setting the ABI is not enough.

      You need to tell vcvarsall.bat the Visual C++ version you want. Just add -vcvars_ver=14.29 to the empty field just like in the picture below:

      qtcreator-14-msvc2022-vc142-kit.png

      You might want to restart Qt Creator so that the environment for vcvarsall.bat would be rescanned.

      See it in action below, with the expected results:

      qtcreator-14-msvc2022-vc142-cmake.png

      1 Reply Last reply
      2
      • Ronel_qtmasterR Offline
        Ronel_qtmasterR Offline
        Ronel_qtmaster
        wrote on last edited by
        #2

        Your Problem is simple, all you have to do is installing microsoft visual studio 2019 with Visual Studio SDK and Qt will detect and setup compilers automatically.You do not need to setup by yourself. Moreover, all qt versions have specific versions of visual studio they can use. I am Using 2019 for MSCV2019 so maybe you can give it a go as well.

        1 Reply Last reply
        0
        • cristian-adamC Offline
          cristian-adamC Offline
          cristian-adam
          wrote on last edited by
          #3

          It is possible to achieve this, but setting the ABI is not enough.

          You need to tell vcvarsall.bat the Visual C++ version you want. Just add -vcvars_ver=14.29 to the empty field just like in the picture below:

          qtcreator-14-msvc2022-vc142-kit.png

          You might want to restart Qt Creator so that the environment for vcvarsall.bat would be rescanned.

          See it in action below, with the expected results:

          qtcreator-14-msvc2022-vc142-cmake.png

          1 Reply Last reply
          2
          • C chenke404 has marked this topic as solved on
          • C Offline
            C Offline
            chenke404
            wrote on last edited by
            #4

            Yes, you're right. Thank you for your help.@cristian-adam

            1 Reply Last reply
            1
            • cristian-adamC cristian-adam referenced this topic on

            • Login

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