This is an old revision of the document!


Building Qt on Windows

Download the sources from http://qt.nokia.com/downloads (choose “LGPL” and “Framework Only”) and run the installer. Accept the default answer to every question and ignore the warning about using the wrong MinGW version (the one Qt wants to use is prehistoric and completely unusable).

There is (at least) one known bug in 4.4.x, which is that Qt includes incorrect prototypes for Windows's atomic increment / decrement / compare / exchange primitives, see for instance:

As a workaround, edit C:\Qt\4.4.0\src\corelib\arch\qatomic_windows.h (or the equivalent on your system). Add #if 0 before line 393 and the corresponding #endif before line 400, so the entire block looks like this:

#if 0
extern "C" {
    __declspec(dllimport) long __stdcall InterlockedCompareExchange(long *, long, long);
    __declspec(dllimport) long __stdcall InterlockedIncrement(long *);
    __declspec(dllimport) long __stdcall InterlockedDecrement(long *);
    __declspec(dllimport) long __stdcall InterlockedExchange(long *, long);
    __declspec(dllimport) long __stdcall InterlockedExchangeAdd(long *, long);
}
#endif
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • diana/windows/building/qt.1261144329.txt.gz
  • Last modified: 2022-05-31 09:23:14
  • (external edit)