Best source for MinGW
-
I am looking to set up Qt 4.8 using MinGW tools. There appears to be various sources to get the compiler and set it up. Is there a preferred location to set up the MinGW compiler for Qt? I currently use a library set of Qt for the Win 7.1 SDK and Qt 5.0.0 doesn't show a release yet for MinGW.
-
"MinGW-builds":http://sourceforge.net/projects/mingwbuilds/. This is also used by the QtProject CI and will be the preferred choice for Qt5.
-
"This":http://tdm-gcc.tdragon.net is also a good package.
-
[quote author="broadpeak" date="1357636599"]"This":http://tdm-gcc.tdragon.net is also a good package.
[/quote]I second that.
Furthermore "Komisar":http://komisar.gin.by/mingw/index.html also has up-to-date MinGW builds and other goodies.
-
Thanks all for responding. Lukas, what is the difference between the "MinGW-builds":http://sourceforge.net/projects/mingwbuilds/ and the "MinGW-get-inst":http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/ ? The latter appears to be an installer of the build. It looks like build is not as current as the former. If the Qt Project will consider the former to be the preferred choice, is there a set up specific to it?
-
MinGW-get-inst is not related to MinGW-builds. The former one provides basically a packaging system for MSYS, a set of Unix tools compiled for Windows (one of those tools beeing the compiler, GCC); the latter one is just the compiler.
There is no installation to MinGW-builds. Just extract it and let the %PATH% point to it.
-
[quote author="astodolski" date="1357655215"]Thanks all for responding. Lukas, what is the difference between the "MinGW-builds":http://sourceforge.net/projects/mingwbuilds/ and the "MinGW-get-inst":http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/ ? The latter appears to be an installer of the build. It looks like build is not as current as the former. If the Qt Project will consider the former to be the preferred choice, is there a set up specific to it?[/quote]mingw-get is the package manager (similar to apt-get) for the original MinGW + MSYS toolchain (maintained by MinGW.org).
MinGW.org only supports 32-bit compilers. A fork was created, called MinGW-w64, to create a 64-bit version (although they also develop a 32-bit version). Unfortunately, there seems to be some politics at play, and the 2 projects haven't merged. Rather, they've continued developing quite independently. The last I heard, MinGW-w64 actually has better support for the Windows API now, compared to MinGW.org.
MinGW-builds is yet another project, that provides easy-to-use packages for both 32-bit and 64-bit variants of MinGW. IIRC, they use the source code from MinGW-w64
-
Ok so if I understand correctly, the former contains the compiler plus command line tools, whereas the latter is only the compiler. Additionally, I don't need any environment set up of the host machine. Just include the install folder in the PATH.
-
[quote author="astodolski" date="1357658760"]Ok so if I understand correctly, the former contains the compiler plus command line tools, whereas the latter is only the compiler. Additionally, I don't need any environment set up of the host machine. Just include the install folder in the PATH.[/quote]
Almost. You need to consider that the MinGW doesn't exist. It's OpenSource software, so different forks happen to exist, in parallel. As JKSH explained, there are at least two main "flavors" of MinGW: The original MinGW.org project and the MinGW-w64 project, both based on GCC/Gygwin and the latter originally forked off from the former. Also different people built MinGW with different compilers and/or compiler settings and/or custom patches and/or different libraries included. In my experience grabbing one of the widely-used "all-in-one" MinGW packages, as provided by TDM-GCC (or MinGW-builds) is the easiest way to get an up-to-date and working MinGW environment.
BTW: If you need to run "./configure" scripts and the like, you will also need MSYS in order to get a Linux-style Shell on Win32. This probably won't be needed for Qt Creator, but a lot of OpenSource tools need it.
-
[quote author="MuldeR" date="1357665184"][quote author="astodolski" date="1357658760"]Ok so if I understand correctly, the former contains the compiler plus command line tools, whereas the latter is only the compiler. Additionally, I don't need any environment set up of the host machine. Just include the install folder in the PATH.[/quote]
Almost. You need to consider that the MinGW doesn't exist. It's OpenSource software, so different forks happen to exist, in parallel. As JKSH explained, there are at least two main "flavors" of MinGW: The original MinGW.org project and the MinGW-w64 project, both based on GCC/Gygwin and the latter originally forked off from the former. Also different people built MinGW with different compilers and/or compiler settings and/or custom patches and/or different libraries included. In my experience grabbing one of the widely-used "all-in-one" MinGW packages, as provided by TDM-GCC (or MinGW-builds) is the easiest way to get an up-to-date and working MinGW environment.
BTW: If you need to run "./configure" scripts and the like, you will also need MSYS in order to get a Linux-style Shell on Win32. This probably won't be needed for Qt Creator, but a lot of OpenSource tools need it.[/quote]
I tried adding the MinGW-builds as a tool chain to the Qt SDK to try things out. The compile output window shows builds fall down immediately.
6:26:01: Running build steps for project example...
16:26:01: Starting: "C:\mingw\bin\mingw32-make.exe" clean
qtcreator_ctrlc_stub: Command line failed: C:/mingw/bin/mingw32-make.exe clean
16:26:01: The process "C:\mingw\bin\mingw32-make.exe" crashed.
16:26:01: Configuration unchanged, skipping qmake step.
16:26:01: Starting: "C:\mingw\bin\mingw32-make.exe"
qtcreator_ctrlc_stub: Command line failed: C:/mingw/bin/mingw32-make.exe
16:26:01: The process "C:\mingw\bin\mingw32-make.exe" crashed.
Error while building project example (target: )
When executing build step 'Make'I have the compiler however located at:
C:\mingw\bin\x86_64-w64-mingw32-g++.exe
-
[quote author="Lukas Geyer" date="1357632541"]"MinGW-builds":http://sourceforge.net/projects/mingwbuilds/. This is also used by the QtProject CI and will be the preferred choice for Qt5.[/quote]
I installed the build you pointed to. I then proceeded to install Qt 4.8.4 for MinGW. The installer when asked for a location of the compiler complained with a dialog box stating: There is a problem with your MinGW installation: The installer could not find a valid c:\mingw\include\w32api.h (only versions with W32API 3.13 are supported)
There's not even a w32api.h file present in the include folder.
Any help appreciated.
-
There should be a w32api.h in mingw/i686-w64-mingw32/include.
Be aware that MinGW 4.4, which is used to build the official binaries, is not binary compatible with MinGW 4.7 which you have downloaded from MinGW-builds. This means that you will have to compile Qt with the compiler you've just downloaded. You cannot use the official libraries with it.
Fortunately this is no rocket science. Just grab the sources, <code>configure</code> and <code>mingw32-make</code>.
I recommend to not revert to MinGW 4.4 just to be able to use the official binaries.
-
[quote author="Lukas Geyer" date="1357731905"]
I recommend to not revert to MinGW 4.4 just to be able to use the official binaries.[/quote]
Can you elaborate with a few more sentences on this statement?If I understand yours and MuldeR's comments correctly, we could end up with a 32 bit version of the MinGW 64 bit version. Also version 4.7.2 of the different branches might show different behaviour in performance and bugs. Are there known differences already? Is the scenario as dark as one might imagine?
-
[quote author="Lukas Geyer" date="1357731905"]There should be a w32api.h in mingw/i686-w64-mingw32/include.
Be aware that MinGW 4.4, which is used to build the official binaries, is not binary compatible with MinGW 4.7 which you have downloaded from MinGW-builds. This means that you will have to compile Qt with the compiler you've just downloaded. You cannot use the official libraries with it.
Fortunately this is no rocket science. Just grab the sources, <code>configure</code> and <code>mingw32-make</code>.
I recommend to not revert to MinGW 4.4 just to be able to use the official binaries.[/quote]
I agree with the suggestion of not reverting to MinGW 4.4.
So then can I assume that the updated Qt libraries are an upgrade to the Nokia supplied SDK?
-
[quote author="koahnig" date="1357734990"][quote author="Lukas Geyer" date="1357731905"]
I recommend to not revert to MinGW 4.4 just to be able to use the official binaries.[/quote]
Can you elaborate with a few more sentences on this statement?[/quote]
I see mainly two problems with MinGW 4.4 (as used by the official builds for Qt4); it is based on MinGW.org, which means inferior Windows API support, which is way better on MinGW-w64, and it is based on GCC 4.4, which is heavily outdated, also in terms of quality. For instance using it as a C++11 compiler will most probably result in pure frustration, because you are welcomed with segmentation faults all over the place.Having no official binaries for MinGW 4.7.2 should not be a reason to use MinGW 4.4 instead, because compiling Qt with MinGW 4.7.2 is way less of an issue than using MinGW 4.4.
[quote author="koahnig" date="1357734990"]If I understand yours and MuldeR's comments correctly, we could end up with a 32 bit version of the MinGW 64 bit version.[/quote]We will as it is.
The recommended packages are mingw-builds, SJLJ exceptions, POSIX threading for either 32 bit or 64 bit (GCC 4.8 will bring SEH exception support).
Be aware that although it reads MinGW-w64, it is not related to 64 bit. mingw-builds for instance offers builds of MinGW-w64 for both, x86 and x64 host beeing capable to either produce x86 or x64 code, including cross-compilation (for example building x86 applications on a x64 host and vice versa).
[quote author="koahnig" date="1357734990"]Also version 4.7.2 of the different branches might show different behaviour in performance and bugs. Are there known differences already?[/quote]Yes, although all of them use GCC and the MinGW-w64 runtime, they do build for instance GCC differently, with differing optimizations or patches included, cross-compilation options enabled or disabled, features like OpenMP included or excluded, a different threading model selected; even within one distribution, like mingw-builds, there are different "revisions":http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.7.2/.
A summary has been made during the distribution selection process, which can be found "here":http://qt-project.org/wiki/MinGW-64-bit.
-
[quote author="astodolski" date="1357735005"]So then can I assume that the updated Qt libraries are an upgrade to the Nokia supplied SDK?[/quote]There are no Nokia SDKs any longer; they are now provided by the QtProject.
Official Qt4 libraries are still based on MinGW 4.4 (and I have no information that this is going to change), Qt5 libraries will be based on MinGW 4.7.2 from mingw-builds when they are released (planned for Qt 5.0.1).
-
[quote author="Lukas Geyer" date="1357742415"][quote author="koahnig" date="1357734990"][quote author="Lukas Geyer" date="1357731905"]
I recommend to not revert to MinGW 4.4 just to be able to use the official binaries.[/quote]
Can you elaborate with a few more sentences on this statement?[/quote]
I see mainly two problems with MinGW 4.4 (as used by the official builds for Qt4); it is based on MinGW.org, which means inferior Windows API support, which is way better on MinGW-w64, and it is based on GCC 4.4, which is heavily outdated, also in terms of quality. For instance using it as a C++11 compiler will most probably result in pure frustration, because you are welcomed with segmentation faults all over the place.Having no official binaries for MinGW 4.7.2 should not be a reason to use MinGW 4.4 instead, because compiling Qt with MinGW 4.7.2 is way less of an issue than using MinGW 4.4.
[quote author="koahnig" date="1357734990"]If I understand yours and MuldeR's comments correctly, we could end up with a 32 bit version of the MinGW 64 bit version.[/quote]We will as it is.
The recommended packages are mingw-builds, SJLJ exceptions, POSIX threading for either 32 bit or 64 bit (GCC 4.8 will bring SEH exception support).
Be aware that although it reads MinGW-w64, it is not related to 64 bit. mingw-builds for instance offers builds of MinGW-w64 for both, x86 and x64 host beeing capable to either produce x86 or x64 code, including cross-compilation (for example building x86 applications on a x64 host and vice versa).
[quote author="koahnig" date="1357734990"]Also version 4.7.2 of the different branches might show different behaviour in performance and bugs. Are there known differences already?[/quote]Yes, although all of them use GCC and the MinGW-w64 runtime, they do build for instance GCC differently, with differing optimizations or patches included, cross-compilation options enabled or disabled, features like OpenMP included or excluded, a different threading model selected; even within one distribution, like mingw-builds, there are different "revisions":http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.7.2/.[/quote]
Thanks Lukas for the excellent summary. Looks a like a mess we are ending up with MinGW. Especially when the compiler flavours show differences.
[quote]
A summary has been made during the distribution selection process, which can be found "here":http://qt-project.org/wiki/MinGW-64-bit.[/quote]
Excellent. Thought about something like this is required.However, we end up with a similar situation as with the different names of MinGW distributions. The wiki name says clearly "MinGW-64-bit", but the article contains information about the recommended 32 bit version. I do not know if the page existed already when I was looking for MinGW 32 bit version in last autumn. Even, if it was already available, I would not have looked there for 32 bit information. So I ended up with downloading the compiler from original, but out-dated MinGW.org page. :(
I am suggesting a name change of that wiki page. -
The good thing is that all of those flavours should generate compatible code (as long as you stick to the same exception and threading model) and as you are required to deploy Qt with your application anyway on Windows you are theoretically free to choose your flavour as long as it works for you. There will be, however, just one flavour which is officially supported, and I second the selection of mingw-builds.
Yes, the name is quite misleading, it should probably read MinGW for Qt5 or just MinGW. What do you think?
-
[quote author="Lukas Geyer" date="1357742639"][quote author="astodolski" date="1357735005"]So then can I assume that the updated Qt libraries are an upgrade to the Nokia supplied SDK?[/quote]There are no Nokia SDKs any longer; they are now provided by the QtProject.
Official Qt4 libraries are still based on MinGW 4.4 (and I have no information that this is going to change), Qt5 libraries will be based on MinGW 4.7.2 from mingw-builds when they are released (planned for Qt 5.0.1).[/quote]
I understand there is no SDK any longer - certainly not the one that was from Nokia. Installing Qt along with a MinGW compiler was initially done using the SDK 1.1 which was available here. Every subsequent revision to the Qt library was just that. Meaning if you were to install the updated library after having the SDK, the compiler remains at version 4.4 which is included in the SDK. If someone were to install Qt 4.8.4 for MinGW for the first time, then locate the latest MinGW compiler, you can see that it is not a smooth set-up. There are obvious issues which I am seeing. This is why I asked if the revision path with the updated library had as a basis the original SDK.
-
[quote author="Lukas Geyer" date="1357746695"]
Yes, the name is quite misleading, it should probably read MinGW for Qt5 or just MinGW. What do you think?
[/quote]
There is also a parenting folder called MinGW. When you go onto this it actually allows its creation, because a wiki is not existent.
So either- to place some more general information there :)
- to add a sentence indicating that there more detailed information under MinGW-64-bit for 32 bit :(
Rename the MinGW-64-bit page in all cases. MinGW for Qt5 is as misleading, since the information is also valid for Qt4. How about MinGW-builds(current_recommendation_for_Qt) ?
This would leave room in case of odds and another MinGW gets selected at the end. Otherwise MinGW-builds sounds good to me.
The first sentence of the wiki page should be then:
"This is mainly about selecting the right MinGW package for Qt 5."