Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to install and configure any working MSVC build tools with Qt Creator



  • I have Qt Creator 4.10.2. on Windows 10. If I have understood correctly the bluetooth module doesn't work on Win7 (which I would prefer to use right now) and even on Win10 not with mingw, only with MSVC version of Qt libraries. Therefore I want to install a MSVC compiler on Win10. I want to have a minimal installation, without the fullblown VS (and especially I'm not going to pay for it) and I may do non-opensource development. If I have again understood correctly, I can use the MS build tools for that. But there's no apparent way to get the older build tools (Qt seems to support only 2015 or 2017). I can install them with the 2019 build tools installer. But...

    When I have installed the build tools 2019 (with 2017 option) Qt Creator doesn't find them and I gave up trying to figure up how to possibly add it manually. I added the build tools to PATH in the installation phase.

    So, can someone help with this problem? Preferrably by adding the bluetooth support to mingw version on Windows 7 :) But secondarily by telling how can I get Qt Creator working with MS build tools. Exact version of Qt or Creator shouldn't be a problem. I just want to do quick development on a desktop platform without going to Android immediately.


  • Lifetime Qt Champion

    Hi @Eeli-K,

    First of all, I'm not the expert when it comes to BT. But if I understand correctly, the MS compiler was needed so far, because BT was only available when your app was compiled as UWP (Universal Windows Platform) app.

    But there is a change in the upcoming (only few weeks left, beta already available) Qt 5.14 version: https://doc-snapshots.qt.io/qt5-5.14/qtbluetooth-index.html

    If I get it right, you should be able to use BT with 5.14 and the Win32 port on Windows 7 upwards even with the MinGW compiler. @kuzulis, is that information correct?

    Regards



  • Thanks for the reply, that's interesting. The information in the doc isn't very clear. I quote it verbatim:

    "Qt 5.14 adds a native Win32 port supporting Classic Bluetooth on Windows 7 or newer, and Bluetooth LE on Windows 8 or newer. It must be enabled at build time by configuration option -native-win32-bluetooth. The UWP backend is used by default if this option is not set and the Win32 target platform supports the required UWP APIs (minimal requirement is Windows 10 version 1507, with slightly improved service discovery since Windows 10 version 1607)."

    So, I still don't have bluetooth support on Win7 because I'm not going to recompile Qt with this 10 year old machine - or is it compiled in the precompiled binaries?

    I don't know anything about UWP. Can I use the UWP version on Win 10? According to maintenance tool it requires MSVC, so I would face the original problem anyways (namely that Qt Creator doesn't find the compiler tools).

    As for "native Win32 port", does it mean I have to use 32 bit Qt binaries? Is the MSVC version still required, and if yes, why isn't it told clearly in the documentation?


  • Lifetime Qt Champion

    @Eeli-K said in How to install and configure any working MSVC build tools with Qt Creator:

    So, I still don't have bluetooth support on Win7 because I'm not going to recompile Qt with this 10 year old machine - or is it compiled in the precompiled binaries?

    I don't know that, but if not, it should be enought to recompile qtbluetooth. No need to recompile everything.

    I don't know anything about UWP. Can I use the UWP version on Win 10? According to maintenance tool it requires MSVC, so I would face the original problem anyways (namely that Qt Creator doesn't find the compiler tools).

    I guess all that is true - I have never used UWP myself.

    As for "native Win32 port", does it mean I have to use 32 bit Qt binaries?

    No, they mean pure Windows API, no UWP required.

    Is the MSVC version still required, and if yes, why isn't it told clearly in the documentation?

    I don't know that, but I assume it will work with MinGW.

    You can already download the beta versions with the online installer/MaintenanceTool, so probably you can just try yourself?!

    Regards



  • I haven't found a fully satisfactory solution, but I found out how to install older VS 2017 Community. It wasn't hassle free, I had to find a link to older versions from VS 2019 main page, then sign up with some MS something. I'm not happy with installing the whole VS but at least it works for now and the bluetooth module works.

    I tried Creator 4.11.0-beta2 but it didn't detect 2017 build tools from 2019 installer. I didn't try the latest Qt beta version.


  • Moderators

    @Eeli-K yeah that seems to be a problem. I have msvc2017 and 19 installed and QtC only detects the 2019 compilers.

    But that's actually not much of an issue. since MSVC 2015 the compiler are backwards compatible, and I'm using MSVC2019 with 2017precompiled Qt.
    Gives a warning in the Kit section, but that's about it.



  • For some reason QtC didn't find anything from the 2019 installation.

    BTW, stupid me: the plain Build Tools of 2017 are downloadable from the same place as VS 2017. Not that it actually seems to matter much: it takes huge amount of time and disk space anyways.


Log in to reply