Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Can I use MinGW64 and how can I set this up for c++ application development in Qt



  • I'm a newbie to Qt so if someone could dumb down an explanation on how to configure MinGW64 with Qt that would be awesome! I've read through the initial documentation on changing compilers https://doc.qt.io/qtcreator/creator-tool-chains.html. The following "unsuccessful" steps are what I took in trying to configure MinGW64 with Qt. Could someone help me troubleshoot and get MinGW64 up and running. I would really like to use an optimized 64 bit compiler rather than a 32 bit compiler.

    Step 1:

    I went to this site https://sourceforge.net/projects/mingw-w64/ and downloaded the MinGW64 bit compiler. The installation was extremely easy as it walked me through a very standard easy install that took less than 10 minutes. Installed it under my C drive as shown here http://imgur.com/3RwMDqx.

    Step 2:

    I added it to the Path variable as shown here http://imgur.com/uO3suoh. I assume the "bin" location contains the files needed by Qt to build my sources. One thing that really confuses me is the terminology that people use which is "build" "make" "compiler". To me all these are the same. The compiler holds a make file I assume which when invoked builds my source?! Wouldn't mind a small explanation on this cause I do remember Qt calls for the location of the make file so I assume I have to add that somewhere?!

    Step 3:

    I rebooted my computer for the changes to my Path variable to take place.

    Step 4:

    Started up Qt and created a new Qt Console Application Project named HelloWorld as shown here http://imgur.com/KNm5Wcg. I had created a collection folder under my C drive for all my Qt projects so I used that as the project location.

    Step 5:

    Qt automatically detected the MinGW 32bit compiler kit http://imgur.com/xGBfDm6 which is weird because I never really specified MinGW's 32 bit bin folder in my path variable. I only did that for my MinGW 64 bit compiler initially. So Qt must do a system wide search or something to know that I have installed MinGW 32bit or it comes already with Qt as a bundle. Alittle confused about that. Anyways the point I want to make here is that Qt didn't only detect my MinGW 64 Compiler I installed in Step 1 but it didn't even detect it after I added it to my path variable and did a system restart. Epic fail!! Moving on through this horrible endeavor....

    Step 6:

    I figured that I would manually have to add a compiler as stated in the Qt documentation I pasted in above at the start of this thread. So at this point I selected the normal MinGW 32 bit compiler and proceeded through setting up my project. I built a simple hello world program and clicked on "build". It successfully built my project as shown here http://imgur.com/SVZmxJj. I would still appreciate an explanation to why Qt was able to find my MinGW 32 bit compiler without initially adding it to my path variable. That seems strange to me. Usually you need to physically add these compilers to your environment variable "Path". Anyways moving on..

    Step 7:

    The Qt documentation shows me how to add a compiler but its not to great at explaining how to add a specific compiler or a specific explanation to each field. Therefore, I went in to Tools > Options > Build & Run > Kits. I clicked on "Add" and typed in "MinGw_64" in the Name field. I'm at lost on what the other fields are and what I'm suppose to fill in for them. Noticed in the image here http://imgur.com/UdVWEhO after I did all this that it put a red circle by MinGw_64 under Manuel. I assume there are some configuration steps I have yet to do. Its hard to grab a screeshot of this since I have to hoover over it with the mouse so I took a picture of it with my phone http://imgur.com/jLGqVnl.

    So that pretty much does it. I did go ahead and compile and it failed as expected. I'm sure somewhere here has configured MinGW, cygwin64 or some 64 bit compiler. I would appreciate any direction at this point. Like I initially stated all I want is a nice optimized 64 bit compiler as I'm doing some pretty heavy C++ Digital Signal Processing development.



  • First of all you should check that the version of your MinGW-64 is not less than 5.3.
    As it seems, your main problem is that you try to use your MinGW-64 compiler with the qt libraries compiled with another compiler. So, if you want to use MinGW-64, you must build qt libraries yourself with the use of it. Check this and this.



  • Thanks for the reply. Wow....that looks like a very long process. I'm surprised that Qt doesn't provide an easier way to implement 64 bit compilers.


  • Qt Champions 2017

    Qt has 64 bit pre-built library for linux,OSX and Visual Studio. It does not have built libraries of 64 bit MINGW compiler. You need to just compile the Qt source for MINGW64 bit. This may take 3-4 hours time. Once done it is easy to setup rest. It is pretty seamless process if you are really interested.



  • @dheerendra I'm confused when you say "64 bit build for Visual Studio. I thought Visual Studio was a IDE/Compiler all in one. Think i'm confused on what Qt is. I thought Qt was a C++ IDE??? So how and why would anyone integrate Qt with Visual Studio???? I'm using Qt in the hope that I don't have to touch Visual Studio.


  • Lifetime Qt Champion

    @regnar86 Qt is a C++ framework and can be used with any C++ compiler (like GCC, Microsoft Visual C++, ...). It is not an IDE. QtCreator is an IDE.
    Visual Studio is an IDE wich allows you to develop with different languages like C++, C#, ... But you can use Microsoft compilers outside of Visual Studio - they are not build into the IDE. That means you can use Visual C++ compiler in QtCreator.
    You can use Qt in Visual Studio, but you don't have to. You can use Qt in QtCreator with Visual C++ compiler.


Log in to reply