How can I select a compiler version that's compatible with my Qt version?



  • I may have installed Qt incorrectly; if so, I'll need instructions on how to correct the installation.
    When I select Tools/Options/Kits,
    under the Qt Versions tab, I see two versions:
    Qt 5.11.1 MSVC2017 64bit
    Qt 5.11.1 for UWP 64bit (MSVC 2017)

    Under the Compilers tab, I see 6 compilers
    Microsoft Visual C++ Compiler 14.0 (xxx), where xxx is any one of the following:
    x86, amd64_x86, amd64, x86_amd64, x86_arm, amd64_arm

    Under the Kits tab, every combination I've tried of compiler and Qt version has problems. When I select x86, a mouseover of the kit shows a yellow window saying that the compiler and Qt have different ABIs. When I select any of the other compiler options, the yellow window always says "The compiler (compiler name) may not produce code compatible with Qt version (Qt version name)".

    What do I need to do to have a compiler that will produce code compatible with Qt? I'm using 64-bit Windows 10 on an x64-based processor.



  • Hello @James-Kuyper and Welcome!

    You ask the most common but also the most frustrating to answer question. It is akin to... "For what purpose do I exist?"

    But seriously, I tend to avoid M$ compilers and use MSYS2 as my development platform. This gives me the best and most up-to-date compiler to target both i686 and x86_64 based platforms. This also keeps me constrained from M$isms that keep me from being able to target linux, MacOS, etc.

    From the information you have given, I would say that you installed Qt for M$VC2017 and you actually have M$VC2015 compiler. Try reinstalling Qt but install MSVC2015.

    If you like developing under linux and choose to try MSYS2, I have install topics available.

    Enjoy!


  • Moderators

    First, try "Qt 5.11.1 MSVC2017 64bit" with the amd64 compiler and ignore the compatibility warning.

    Are you able to build and run an example app?

    @James-Kuyper said in How can I select a compiler version that's compatible with my Qt version?:

    Qt 5.11.1 MSVC2017 64bit

    This is for traditional desktop applications.

    Qt 5.11.1 for UWP 64bit (MSVC 2017)

    This is for Universal Windows Platform apps (the Windows 10 version of "Metro" apps).

    Under the Compilers tab, I see 6 compilers
    Microsoft Visual C++ Compiler 14.0 (xxx), where xxx is any one of the following:

    This is MSVC 2015. In theory, it is fully compatible with MSVC 2017.

    x86, amd64_x86, amd64, x86_amd64, x86_arm, amd64_arm

    Since you downloaded 64-bit Qt, then you want to use the 64-bit compiler (amd64).

    x86 is 32-bit.

    _arm refers to a cross-compiler for ARM CPUs (which are found in mobile phones and embedded devices like Raspberry Pi).

    When I select x86, a mouseover of the kit shows a yellow window saying that the compiler and Qt have different ABIs.

    That's expected, because you cannot mix 32-bit and 64-bit binaries.

    When I select any of the other compiler options, the yellow window always says "The compiler (compiler name) may not produce code compatible with Qt version (Qt version name)".

    Qt Creator does not realize that MSVC 2015 is compatible with MSVC 2017, so ignore the warning for now and see if it works.

    If it doesn't work, you could try upgrading your compiler to MSVC 2017, rebooting, then trying again.

    If that still doesn't work, follow @Buckwheat's suggestion and install the MinGW 5.3.0 compiler (through the Qt Maintenance Tool). You will also need to uninstall "Qt 5.11.1 MSVC2017" and install Qt 5.11.1 MinGW 5.3.0 instead.



  • @Buckwheat The choice of Microsoft Windows in general, and of MSVC in particular, was made by my employer - I don't get a say in the matter. At home, and at previous jobs, I prefer Linux. And, as I found out after reading your message, my employer deliberately chose MSVC2015 rather than MSVC2017. It was easy to fix, once I realized that it was just a matter of choosing a version of Qt that was compatible with MSVC215.



  • @JKSH After downgrading to a version of Qt that feels comfortable working with MSVC2015, I had no trouble building the Hello GL2 Example.



  • @James-Kuyper it seems your issue is solved, great. If so, please don't forget to mark your post as such. Thanks.


Log in to reply
 

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