Building 64-bit Qt 4.7 using MinGW-w64(Nov 12, 2010)
I successfully built 64-bit Qt libraries using MinGW-w64. Although I had to change Qt source code, it was only one line of code in the current source tree of qt-mingw-w64. The steps I took to built 64-bit Qt are described below. Note that my explanation is a bit verbose, as those who just start using MinGW or Qt may need additional information.
- Obtain Qt 4.7 source code.
- Go to http://gitorious.org/+qt-mingw-w64/qt/qt-mingw-w64-qt
- Click on the 'Source tree' button. Note that you can directly go to this link. However, go to the link above allows you to read recent activities of Qt development that may related to you.
- On the right side, you see several 'branches'. As of Nov 12, 2010, the one you want to use is plain '4.7,' which already merges Webkit facility.
- Once you click on the '4.7' button, you probably need to wait a minute or two. This allows the server to create tar.gz for downloading. Basically, the package is prepared on the fly. This is how gitorious works.
- Go to http://sourceforge.net/projects/mingw-w64/files/
- Click on Section 'Toolchains targetting Win64'
- Pick the release you like. I suggest you use personal build from sezero, as sezero usually adds some patches or features that you might want to use (e.g., updated OpenGL and OpenCL headers). I employed mingw-w64-bin_x86_64-ming_20101003_sezero.zip. By the time you get MinGW from sourceforge, the build may be gone. Yet, you are supposed to get a newer version than mine.
- If you wonder what are inside each sezero build see his note in Section 'Toolchains targetting Win64 -> Personal Builds -> sezero_20101003.' sezero did a good job in bookkeeping (at least it seemed).
- Personal build of rubenvb is probably an interesting choice, as he appears to be a Qt contributor. I believe that his MinGW build should not have a serious issue with Qt compilation.
- Download AS Package (ZIP).
- Unpack and set path to 'base_perl_path/bin' and 'base_perl_path/site/bin.'
- If you want a temporary session path for your command prompt (cmd.exe), type 'set PATH=C:\Perl64\bin;C:\Perl64\site\bin;%PATH%, provided that you unpack its main contents to C:\Perl64 and discard its 'support' folder. Don't close this command prompt yet because your path settings are temporary. You need to use it until the end.
If you want to know what your current path is, type 'echo %PATH%.'
Update (Feb 18, 2011): it is easy to build Qt with phonon. The option, however, is off by default for MinGW. I tested with
configure -opensource -phonon -no-qt3support -nomake example -nomake demos
Although I did not test if the created libraries work or not, things are built smoothly.
The following summarizes downloads and tweaks I made during the above steps. Basically, we need to do only two things in addition to what most people do with mingw 32-bit. I have not try building phonon yet (and I think I don't need it for a long time).
- Qt 4.7 mingw-w64 branch (~ 130 MB). See step 1.
- MinGW-w64 (~ 55 MB). See step 4.
- ActivePerl (~ 24 MB). See step 7.
- Change source code (1 file, 1 line). See step 3.
- Change gmake to mingw32-make.exe. See step 6. (May not be necessary any more.)
Hope this helps,
Additional reference: mingw-w64 mail archive
I welcome questions and comments. Feel free to ask and share if you have any.