How to use Qt with Visual Studio 2017?
-
@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:
-
@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.
-
Hi,
IIRC from another post, you have to clone your VS2015 Kit and point it to the VS2017 compiler, etc.
-
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:
-
Install Visual Studio. Make sure that at least the c++ compiler and Windows SDK components are selected.
-
Install Qt 5.8.0 for VS2015. You don't need any other component.
-
Open QtCreator, go to Tool->Options->Build&Run. Verify that QtCreator detects Visual Studio 2017 (MSVC 15.0).
-
Go to Qt Versions tab. Make sure Qt version you installed is present.
-
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.
-
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.
-
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.
-
[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!!
-
@Eligijus said in How to use Qt with Visual Studio 2017?:
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 customwritingz.net
During its installation, administrator rights are required, if they are not present, the installation is successful, but the binding may not be complete. This is manifested in this way, xxxx.ui should turn into ui_xxxx.h during compilation, but the corresponding utility does not work and an error occurs. You can try reinstalling the plugin by running the studio as an administrator.
-
@JackBerman said in How to use Qt with Visual Studio 2017?:
During its installation, administrator rights are required, if they are not present, the installation is successful, but the binding may not be complete. This is manifested in this way, xxxx.ui should turn into ui_xxxx.h during compilation, but the corresponding utility does not work and an error occurs.
The
uic
tool that processes .ui files is part of Qt library, which is configured after the extension is already installed, so I don't see how running VS as an administrator could change anything. There's no binding at that point because there's nothing to bind yet.If you're having issues with the extension could you start a new thread?