Important: Please read the Qt Code of Conduct -

Setting up the MinGW (gcc) compiler in Qt 5.1.1

  • I've been relentlessly trying to configure version after version of MinGW within Qt and cannot find even the basics elsewhere.

    I'm using Qt Creator 5.1.1 on Windows 7 64-bit.
    Versions of MinGW I've already tried:
    The auto-installed where I can choose version and 64-bit etc

    After I install the compiler (in the recommended "C:\MinGW" directory), it fails to be recognised when I go to Tools > Options > Build & Run > Compilers > Auto-detect in Qt Creator. The general advice has been to add it yourself, however after clicking "Add" to add a manual compiler, I expect that "Compiler path:" means "path" and not a specific executable, but it is forcing me to choose a file (.exe maybe?) as opposed to just the directory everything is located in. There are around 40-50 .exe's within the \bin folder. Which to choose (if at all)?

    This is where I am completely stuck.

    I would be grateful if anyone could offer some advice about what the next step should be. It is ridiculously simple, I imagine, I have just hit a brick wall.

    Thank you!

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    AFAIK having several mingw installed in parallel can lead to problems. Why not just use the pre-built MinGW Qt package ? It setups all what you need

  • Thanks for your reply!

    I Installed Qt with all the extras, etc. But when I tried to build an example project, it displayed the error:
    "error: Qt Creator needs a compiler set up to build. Configure a compiler in the kit options."

    How can I:

    1. Be sure the MinGW Qt package has actually been installed (wouldn't it have defaulted to using this if it had?)?
      2. If it is installed, how can I set it as the defaukt compiler in Qt?

    Thanks you again!

  • Sorted!

    I forgot to mention that I only ever had 1 compiler installed at a time; I uninstalled one before trying another.

    I resorted to Eclipse for the meantime and couldn't get a compiler recognised there either, and found this video on YouTube that not only got it recognized in Eclipse, but also made it autodetect in Qt too!

    I can't believe after 2 days it's finally working!

    Thank you again though!

  • Lifetime Qt Champion

    You're welcome !

    Out of curiosity, how did you install Qt ?

Log in to reply