Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt cannot correctly recognize my MinGW compiler
Qt 6.11 is out! See what's new in the release blog

Qt cannot correctly recognize my MinGW compiler

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
4 Posts 3 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    coolwind
    wrote on last edited by
    #1

    I'm using a MinGW compiler (gcc-13.2.0). But when the project compile, the IDE wrongly detect it as a msvc compiler and launch the wrong build. And then it throw an error:
    "qt requires a c++17 compiler, and a suitable value for __cplusplus. on msvc, you must pass the /zc:__cplusplus option to the compiler."
    There is no doubt that gcc13 has full support for c++17. The error also is designed for msvc compiler. What should I do?
    454c9c03-7117-4f4b-adb5-314afebcbe0d-image.png b7f1c828-720d-44b7-9fe2-30b861a4a469-image.png

    jsulmJ 1 Reply Last reply
    0
    • C coolwind

      I'm using a MinGW compiler (gcc-13.2.0). But when the project compile, the IDE wrongly detect it as a msvc compiler and launch the wrong build. And then it throw an error:
      "qt requires a c++17 compiler, and a suitable value for __cplusplus. on msvc, you must pass the /zc:__cplusplus option to the compiler."
      There is no doubt that gcc13 has full support for c++17. The error also is designed for msvc compiler. What should I do?
      454c9c03-7117-4f4b-adb5-314afebcbe0d-image.png b7f1c828-720d-44b7-9fe2-30b861a4a469-image.png

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @coolwind Check your Kit configuration: the used compiler is specified there.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher moved this topic from General and Desktop on
      • cristian-adamC Offline
        cristian-adamC Offline
        cristian-adam
        wrote on last edited by
        #3

        You need to specify the correct CMake Generator, either Ninja or MinGW Makefiles. See Preferences... > Kits > Kits.

        It looks like you have a Visual Studio generator using msbuild, which is totally wrong.

        1 Reply Last reply
        0
        • C Offline
          C Offline
          coolwind
          wrote on last edited by
          #4

          Emm, thanks. I delete this and create a new project. It works well.

          1 Reply Last reply
          1
          • C coolwind has marked this topic as solved on

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved