MinGW-Linux

Outdated!

Cross compiling for Windows on Linux using MinGW

Warning: Cross compilieren (i586-mingw32msvc-g++ (GCC) 4.2.1-sjlj (mingw32-2)) doesn't seem to work - the program crashes on startup on Windows 7! Using the native compiler 4.4.0 on Windows it works.

The problem seems to be related to threads and exceptions.

It is also possible to compile for [Windows] on Linux. This can be useful for automating compilation.

This page is valid for Ubuntu 10.04 Lucid.

At the moment, there is not infrastructure for cross compiling. Additionally, we'll have to find out how to compile the Qt MySQL plugin.

Installing software

Install the cross compiler from the mingw32 package. The version does not have to be identical to the version used to compile Qt, but probably the difference may not be too big.

The Qt library can be copied from the Qt SDK (qt/bin, qt/include, qt/lib and qt/src). The same version (moc -v) is required for Windows and Linux because the build tools (qmake, moc, uic, qrc...) run on Linux. It might be possible to use the build tools from the Windows version with wine.

Compile the Qt MySQL plugin

Should be similar to the way with MinGW on Windows

Changes to the build system

In startkladde.rc, \\ must be replaced with /

Libraries

Some libraries are required:

  • mingwm10.dll from /usr/share/doc/mingw32-runtime
  • Qt4*.dll und libgcc_s_dw2-1.dll from the Windows Qt install

Literatur

([http://doc.trolltech.com/4.6/deployment-windows.html From the Qt documentation]):

See also


Related

Wiki: Home