No copy is necessary, the problem with the libgcc_s_dw2-1.dll dependency in the projects can be resolved by simply adding the line:
in the respective .pro files.QMAKE_LFLAGS += -static-libgcc
As for the problem with qmake.exe not running correctly from a standard command prompt (and thus Qt Creator not being able to correctly locate the static Qt installation), I managed to have configure build a completely static version of QMake, by editing the files Makefile.win32, Makefile.win32-g++ and Makefile.win32-g++-sh (didn't know exactly which of the 3 would be actually used when configure builds QMake) inside the \qmake subdirectory:
Originally Posted by C:\Qt\2010.01-Static\qmake\Makefile.win32*
Now, one step remained for making the tweaking of .pro files unnecessary: Editing \mkspecs\win32-g++\qmake.conf to add:
Originally Posted by C:\Qt\2010.01-Static\mkspecs\win32-g++\qmake.conf
I verified by, yet again, starting from scratch with a freshly extracted source tarball, making the aforementioned changes and building Qt. The results:
1. Qt Creator picks up correctly the static Qt installation from its version management panel
2. You can switch between Qt Versions being used for the building of a project, without the need to manually tweak the .pro file or arbitrarily copy files inside the new Qt installation's directory. The static executable produced has no external Qt or MinGW dependencies whatsoever.
After all the above, may I propose that an addition be made to the Wiki article, incorporating the 2 changes I mentioned and by doing so, providing a clean, out-of-the-box solution? It seems that the introduction of GCC 4.4 in the most recent versions of Qt created the extra dependency upon libgcc_s_dw2-1.dll and the article in its current form deals only with the mingwm10.dll dependency (if only I had arrived to this conclusion earlier!). I will do it myself, but since I'm new here, only after a respectable member of the community verifies my findings and gives the Go signal.
wysota, thanks for the hints, they were really helpful to get to the bottom of this!
Bookmarks