[Qt-interest] Cross-compiling Win32 applications on Mac OS X

Stefan Schmidt stschmail at gmx.de
Tue Mar 1 15:39:55 CET 2011


Hi,
I have been working on a solution to cross-compile win32 applications on Snow Leopard. After several compiles and testing, I could finally create a MinGW cross-compiler (GCC 4.5.2) as well as compile Qt 4.7.2 using this compiler.
To see this in action take a look at
http://www.youtube.com/watch?v=7fMveh_Akgw

If you want to have this yourself, first build and install a cross-compiler using the makefile provided below. To do this, set the path for the toolchain in the makefile's PREFIX variable. If you need root privileges, try commenting out the sudo line below it.
After that, run
  # make -f Makefile.cross-compiler
and wait a while. Make sure that the PREFIX/bin directory is in your path, i.e. run
  # export PATH=$PATH:PREFIX/bin  # replace PREFIX with the path you chose in the makefile.

After that, create an empty directory and unpack qt-everywhere-opensource-src-4.7.2.tar.gz there. Put the configure and configure-win32 files next to the newly created qt-everywhere-opensource-src-4.7.2 directory. Finally run
  # ./configure win32 && cd build-win32-4.7.2 && make && make install
This will certainly take some time but at last, you will have a cross-compiled Qt in /usr/local/qt/4.7.2-win32. If you don't like that path, change the prefix variable in the configure script provided.

One last word on library dependencies: The MinGW will include a dependency on mingwm10.dll in the Qt libraries. You can pick that from the compiler's PREFIX/i586-mingw32msvc/bin directory.

Enjoy your new cross-compiled Qt-4.7.2!

Stefan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile.cross-compiler
Type: application/octet-stream
Size: 10300 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110301/a664fccb/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: configure
Type: application/octet-stream
Size: 597 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110301/a664fccb/attachment-0001.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: configure-win32
Type: application/octet-stream
Size: 5825 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110301/a664fccb/attachment-0002.obj 


More information about the Qt-interest-old mailing list