Qt/MSYS

Whew, finally!

Users of Qt/MinGW have been restricted to compiling and using Qt with the Windows shell cmd.exe. Compilation of Qt would fail even with the presence of the MSYS shell sh.exe in the PATH. This caveat, has over the years, resulted in very many user complaints including this, this, this, this, this and not to mention lots of support requests.

The problem is that the MinGW make mingw32-make starts spawning processes through sh.exe instead of cmd.exe when a sh.exe is found in the PATH. sh.exe, of course, does not understand Windows shell built-in commands and expects the unix path separator / causing compilation to fail.

For 4.3, we have enhanced qmake to detect sh.exe in the PATH and write out a makefile that mingw32-make/sh.exe likes. This means that you can now compile Qt and your programs using the shell of your choice. Other advantages include usage of built-in sh commands and autoconf scripts. It also turns out compilation using sh is way faster than using cmd.exe.

On a more technical note, the new QMAKE_SH variable provides the path to sh.exe (even if you are using MSVC) and MINGW_IN_SHELL is set to “1″ if you are using MinGW inside a shell. If you switch shells, all you need to do is to rerun qmake.

twitter