Qt 5.8 with MS Visual C++ 2015 Build Tools



  • Hello,

    Rather than install the full Visual Studio 2015 Community package to use Qt 5.8 with MSVC2015 I was hoping to use the Visual C++ 2015 Build Tools (http://landinghub.visualstudio.com/visual-cpp-build-tools) however I am having an error with this configuration.

    I do not know if the issue is related to Qt [Creator?] and how it detects MSVC or a difference in how the Visual C++ 2015 Build Tools are installed compared to Visual Studio proper.

    The issue seems to be the location of the UCRT now used by Microsoft. I can manually resolve this by adding the UCRT location to my .pro with a LIBS += -L"location\to\ucrt" however this is not as clean as I would like considering when using Visual Studio this is not required.

    Is anyone here using Qt with Visual C++ 2015 Build Tools and if so have you encountered this issue?

    Many thanks.


  • Moderators

    Which version of Qt Creator do you have?
    Which Windows version?
    Do you want to run a desktop kit or a Windows Runtime kit?
    Can you show your settings in the Build&Run options (Compilers, Qt Versions and Kits tabs)?

    I've been using Build Tools with the latest Qt Creator on Win10 and a desktop Qt kit without problems. All was automatically detected by Qt Creator.



  • Hi Chris,

    Qt Creator 4.2.1, Based on Qt 5.8.0 (MSVC 2015, 32 bit)
    Windows 10 Pro x64 (1607 aka Anniversary Update)
    Desktop kit, no interest in Windows Runtime just yet.

    Unfortunately I had to go back to using Visual Studio rather than the Build Tools as I needed a consistent environment so screen shots of my Build & Run options is not possible anymore.

    Do you have both the Windows 8.1 and Windows 10 (10240) SDKs installed via Build Tools? Did you install anything else such as the Windows SDK? (maybe if you installed the Windows command line debugger?).



  • So I just setup a clean environment and tried to reproduce. This is what I found.

    With Qt 5.8 and Build Tools 2015 (default settings) I get the error. However if I install the Windows SDK (along with the Windows Debugging Tools) the problem disappears.

    When I compare my Visual Studio 2015 system to the Build Tools 2015 + Windows SDK system I see the problem - the Build Tools 2015 installs the Windows SDK for version 10240 whereas Visual Studio 2015 installs version 14393. So by installing Windows SDK 14393 I end up with the same MSVC configuration as I would get by install Visual Studio (of course sans the Visual Studio parts!)

    So problem solved! Not sure why different Windows SDK headers/libs/etc. get installed between what should be the same core product versions but oh well.

    Please see https://en.wikipedia.org/wiki/Windows_10_version_history#PC_version_history for reference on the different version numbers of Windows 10.

    Anyway I am happy I have found the source of the problem. Hopefully this thread can help someone in the future.



  • @satysin

    I have the same issue (i guess), after i've installed qt 5.8 and visual c++ build tools 2015.
    Apparently I'm missing shell32.lib
    but i'm on win7 sp1 x64 (no visual studio installed)

    So I understand I have to also install a windows sdk, but which one?
    In visual c++ build tools installer, i see 2 SDKs, 8.1 and 10 (10240)
    I also found online the download page for 10.14393

    Is 8.1 enough for me?
    Or should I go for 10.14393?
    Or do i need both?
    What would you recommend ?



  • I chose to go with 10.14393, and some examples' compilation works fine.
    At least, for now, i don't see any issues.

    For others in my situation,
    the steps to install qt 5.8 and visual c++ 2015 compiler,
    on win7 x64:

    1. install visual c++ build tools 2015, but uncheck any SDK within the installer.
    2. install windows SDK 10.14393 from microsoft website.
    3. then install qt 5.8 (be sure to check msvc2015 64-bit besides what else you need)


  • @ifmihai

    I found that your steps also worked in my case, but I also installed the Universal CRT: KB2999226. That is because the Windows 10 SDK mentioned that non-Windows 10 platforms must install the Universal CRT. I installed Qt 5.8.0 on a Windows 7 platform.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.