Dugan Chen's Homepage

Various Things

Building 64-bit Qt apps on Windows

The way to build 64-bit Qt apps on Windows is easy. Not obvious, but easy.

First you install the following prerequisites:

  • Visual C++ Express 2010
  • Windows SDK
  • Qt (specifically the source code for the libraries)
  • Qt Creator

Then you build a 64-bit version of Qt against the Microsoft toolchain.

Fire up the Visual Studio command prompt and enter the following command:

CALL "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64

Use cd commands to enter the directory where you extracted the Qt source. Then use the following commands to build it:

configure
nmake

Now, from the same configured Visual Studio command prompt, launch Qt Creator. Start your project and select the 64-bit Qt build to link it against. Qt Creator will now build 64-bit binaries.

Launching Qt Creator from the Visual Studio command prompt should not be necessary, as the known bug necessitating it is documented as having been fixed in the latest versions. In my experience, though, it is indeed still necessary.

If you get the 0xc000007b crash when you run your application on another computer, then you just need to distribute the 64-bit Qt DLLS (starting with QtGui4.dll and QtCore4.dll) with your app.