Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding MinGW compiler to QT 5.6.0 Windows

I am a Total Noob at this and I know nearly nothing about this. I just started using Qt Creator for windows 5.6.0 and While I wrote my first "Hello World" code..

I was asked to add a kit. I searched the net for similar issues and it said that I needed a compiler for Qt. Thus, I installed MinGW from QtForums

now when go to Tools->Options->Build&Run->compiler, I can not understand how do I add it to the list.

Please help me through it?

like image 274
tedd_selene Avatar asked Mar 21 '16 07:03

tedd_selene


People also ask

How do I add MinGW compiler to my path?

In the Windows search bar, type 'settings' to open your Windows Settings. Search for Edit environment variables for your account. Choose the Path variable in your User variables and then select Edit. Select New and add the Mingw-w64 destination folder path to the system path.

Does Qt install MinGW?

Qt supports MinGW as a platform on Windows in addition to Visual Studio compiler by Microsoft. However, it can also be used as a cross-compiler e.g. on Unix (currently not officially supported). Qt Creator supports compiling with a MinGW toolchain out of the box.


2 Answers

To just get started the easiest thing to do would be to go here:

Link to Qt downloads page

Scroll down and select Qt 5.6.0 for Windows 32-bit (MinGW 4.9.2, 1.0 GB) this will download the installer (its about 1 GB). Run it and choose all the default options. Then you will have Qt 5.6 with mingw and Qt Creator all setup ready to go. Note: Before you start that its probably best to delete your current version - if you are not attached to it in any way :)

If you want to fix your current setup, then it might be longer-winded to find out what you are missing for mingw. For example you need the mingw qmake file that would be located here (using default install options):

  • C:\Qt\Qt5.5.1\5.5\mingw492_32\bin\qmake.exe

to create your "Qt Version" part of the kit. And the actual mingw compiler, which is located here (using default install options):

  • C:\Qt\Qt5.5.1\Tools\mingw492_32\bin\g++.exe

to create your compiler. Once you have both of these then you can put them together to create your new kit.

But to just add a compiler all you need to do is:

  • Click compilers tab
  • Click add and select mingw
  • A new compiler is added, click it
  • You will see some options below, add your compiler executable path in (like the one above for example).
  • And you are done - there are some other options, but you probably don't need to use them.

note my paths are for qt 5.5.1 (obviously) so slightly different to 5.6 :)

update

Its all been moved around! - here are the new paths:

offline-installers

old-version-archives

like image 84
code_fodder Avatar answered Sep 29 '22 12:09

code_fodder


Well. I was unable to provide the data before but it all makes more sense now. What I had installed was Qt for windows 64-bit (vs 2013, 836mb).

Hence, Instead of MinGW, I have msvc2013_64. It does have qmake.exe but doesnt have g++.exe. And I had downloaded it separately. You're answer was very helpful.

like image 41
tedd_selene Avatar answered Sep 29 '22 14:09

tedd_selene