Congratulations to our 2022 Qt Champions!

How do we fix "C and C++ compiler paths differ. C compiler may not work."

  • This started after I installed Android Studio, which is a bit worrisome.

    I can't find any place to specify these paths in QtCreator. I viewed the list of compilers and the same one (GCC) is at the top for both C++ and C (under Preferences/Kits/Compilers).

    How do we resolve this?


  • Lifetime Qt Champion

    @Stokestack Go to "Tools/Options.../Kits/Compilers"

  • Thanks for your reply. I did visit that page, but it doesn't seem to provide any explanation. However... that complaint has magically disappeared. Just in case this provides any insight, I'll post a screen shot of the compilers list:


  • Lifetime Qt Champion

    @Stokestack To see how a compiler is configured you have to select it in that list first

  • @jsulm Thanks. I clicked on a few, but I don't see how this explains which compiler is specified for each language, or why Qt thought a different one was being specified for C than for C++.

    It may have been a Qt bug, since the warning message eventually disappeared and I haven't done anything to the configuration. I was just curious as to how one sees which compiler is specified for each language.

  • Lifetime Qt Champion

    @Stokestack There are two sections: one for C and one for C++.
    If you again have this issue compare what you see in C and in C++ sections.
    It's for sure not a Qt (framework) bug, but QtCreator (IDE) one (maybe, could be just a configuration issue).

  • @jsulm Thanks. How does this list answer the question, though? How do I know which compiler is used for C and which is used for C++? It appears to be just a big list of available compilers. If the problem happens again, I don't see how this list helps me.

  • Lifetime Qt Champion

    @Stokestack Which compiler you're currently using is defined in the Kit you're currently using. So check the Kit to see which compiler is used, then got to the Compilers tab and see how it is configured (there are two sections: one for C and one for C++).

  • @jsulm Actually, it turns out that all the necessary information is hidden on the Kits page.

    The problem is that there's no indication (on either of these pages) that you are supposed to click on the list entries. If the detail pane were displayed at all times, it would be clear. But if a nice person likes you takes the time to point out this Easter egg, you get the info:


    The odd part is that A. The warning disappeared, and B. Two different compilers were chosen by default.

  • This post is deleted!

  • Hello, i started to have the same warning after i had updated MSVC 2019 Compilers.
    I corrected this issue by re-detecting compilers list.
    Go to "Tools/Options/Kits"


    then you can remove the "Emscripten Compiler" which is the one causing this warning.

Log in to reply