Important: Please read the Qt Code of Conduct -

Configure MinGW to QtCreator

  • Hi!

    I am trying to configure MinGW kit to QtCreator 2.8.1(Qt 5.1.1 based on MSVC). I want to change my compiler to GCC. I have installed MinGW and added it to KIt and compiler. But still it shows MSVC2012 as default compiler and when I compile a code it says Qt needs a compiler setup to build. Please help me to resolve this. Thanks!

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You can't build an application with MinGW and a Visual Studio Qt build. You need to have both matching.

    The best solution is to uninstall the MinGW you downloaded and install Qt's MinGW package which provides the compiler.

  • Hi!

    Thanks for the reply. But where do I find Qt's MinGW package?

  • Lifetime Qt Champion

    "here": the Windows 32bit MinGW 4.8 OpenGL package

  • I have a project that contains a human-machine interface with Qt (c + +) and I need to use a module reports with Qt to export a report (pdf. ..) but I do not understand how to integrate this module reports in QT5!
    thank you

  • Moderators

    zayani: Please open a new thread for your issue and do not highjack other people's (unrelated) topics.

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Please open a new thread rather than hijacking others with unrelated question.

    You should also add what OS your are using as well as the Qt 5 version and what report module you would like to integrate, what you tried and what failed.

  • This is the ultimate solution to avoid all problems:

    1. Install SDK MinGW OpenGL
    2. Download lates Qt Creator Source
    3. Open Qt 5.2.1 commad prompt and go to Qt Creator source folder
    4. Type where -jN replace N with processor thread amount:
      @qmake -r
      mingw32-make -jN
      mingw32-make install INSTALL_PATH=c:\Qt\Qt5.2.1\tools\QtCreatorMinGW@
    5. Open Windows computer enviromental variables properties and add path:

    Now you can run any program that needs Qt dll's in order to run your programs because the qt bin folder is in PATH.

    Now go and replace all necessary links to orginal MSVC crerator build from start menu QT creator or make copy for new Mingw build Creator and form context menu of pro file open with program and check default and browse new build MinGW creator exe form bin directory.

    Then from newly build Qt Creator Mingw open tools-combiler add the qmake for debugger add gdb from ...5.2.1/mingw*/bin and make new KIT with name QT5.2.1 MinGW for Desktop or similar name.

    Remember to make the new kit as default kit, or Qt Creator will still offer the old build environment always with new project.

    Now everything works.

    This way you can build designer plugins right at your Qt Creator and avoid any build problems with the library as it uses Qt5.2.1 MinGW instead of sourceforge/mingw package which is build depeanding on dwarf 2 and 3 where QT uses dwarf 4.


  • @Jeroi
    Hi, you mention in stop 4. Type where -jN replace N with processor thread amount. As example x86 or 64? Do you have an actual example of that this would look like? Sorry to be such a newbie, but... We all start someplace. :)

  • @RickBlacker
    it's a two year old thread :)
    the -j option in make is used to set how many processes will be used for compiling. It doesn't matter if it's 32 or 64 bit, it's all about the number of cores your machine has. You want them all busy with the compilation, and not idling.

    For me it would look like "make -j4" as I'm typing on a heavy desktop machine with four cores (my resource manager shows 8, but that is just Intel hyperthreading showing virtual cores).

Log in to reply