How to use Qt with Visual Studio 2017?



  • How to configure Qt to support Visual Studio 2017, I have downloaded and installed the latest version of Qt (VS2015) which seems not working with VS 2017. If this version of Qt is not supported VS2017, then the next version when will be released? Thanks!


  • Qt Champions 2016

    @BAHRAMUDIN-ADIL
    Hi you will have to add the kits manually yourself.
    it wont be auto detected. (AFAIK)

    Please see
    https://forum.qt.io/topic/78112/the-visual-studio-2017-is-released-when-qt-msvc2017-version-release/7



  • Qt 5.8.0 compiles fine with VC++ 2017. Else you can wait for 5.9.0.



  • @mrjj Thanks for your reply! I have already tested those steps which you suggested, but it was not working. But I don't to uninstall my VS2017 and install VS2015.


  • Moderators

    @BAHRAMUDIN-ADIL What was not working?



  • Are you looking for Qt VS2017 addin? If that's the case there's beta version qt-vsaddin-msvc2017-2.1.1-beta-10.03.2017.vsix



  • @jsulm It is the problem:
    0_1493992280645_Capture.PNG
    0_1493992354981_Capture1.PNG
    0_1493992366086_Capture2.PNG
    0_1493992371925_Capture3.PNG



  • @Eligijus No, I want to set the compiler of Qt to MSVC2017 which I have already have on my computer. But is not working, I have tried many ways, the suggested ways on this forum, but no one was solved the problem. But when I tried on another PC which has Visual Studio 2015 installed, it was working well.



  • @KeithS How to work, can you tell me how to setup?


  • Lifetime Qt Champion

    Hi,

    IIRC from another post, you have to clone your VS2015 Kit and point it to the VS2017 compiler, etc.



  • @SGaist I really waste my time, but the problem still not solved, why they make it such complex which something impossible???


  • Moderators

    The next release, Qt 5.9, is planned for the end of May: Qt 5.9 release.
    It will contain precompiled binaries for VS2017. For now you can use the ones for VS2015. They are (to some degree) compatible.

    Using VS2017 Is not impossible nor that complex. Just make a kit for it. Here's a step by step for you:

    1. Install Visual Studio. Make sure that at least the c++ compiler and Windows SDK components are selected.
      step 1

    2. Install Qt 5.8.0 for VS2015. You don't need any other component.
      step 2

    3. Open QtCreator, go to Tool->Options->Build&Run. Verify that QtCreator detects Visual Studio 2017 (MSVC 15.0).
      step 3

    4. Go to Qt Versions tab. Make sure Qt version you installed is present.
      step 4

    5. Go to Kits tab. Make sure the kit for that Qt version is present. QtCreator will complain about compiler missing for this version. That's ok because you don't have VS2015 installed. Ignore it.
      step 5

    6. Select the 2015 kit and press "Clone". Select the cloned kit and set it up like this. QtCreator will complain again about incompatible ABIs, but that's ok. The diagnostics don't yet support mixed Qt and VS versions but it will work just fine. Hit "Apply" and close the settings.
      step 6

    7. When creating a project select the newly created kit. You can also add/remove/switch kits for your project later, by selecting the "Projects" tab on the left side of QtCreator.
      step 7

    8. [OPTIONAL] If you need to debug your app see my other post about setting up the debugger for MSVC: Setting up debugger.



  • @Chris-Kawa Thank you for your reply, I will follow the steps you mentioned above, hope it works!!


Log in to reply