How can I build 64 bit Qt on a 32 bit system ?

If you want to build Qt as 64 bit, then you will first have to build the tools that Qt uses as 32 bit then the rest of the Qt libraries can be built in 64bit mode to enable you to build a 64bit version of your application.

The following steps should build everything correctly (using 32bit cp to signify a 32bit Visual Studio command prompt and 64bit cp to signify a 64bit Visual Studio command prompt):

  • 32bit cp: Run configure with the options you want
  • 32bit cp: cd src\tools && nmake (note this will fail at the uic3 step, this is fine)
  • 64bit cp: cd src && nmake (note this will fail at the uic3 step, again this is fine)
  • 64bit cp: cd src\tools\uic3 && qmake
  • 64bit cp: cd src && nmake

Bear in mind that this means you cannot use uic3 as part of your build process because of the fact it links against a 64bit library. Also note that you will not be able to run any of the applications you create with the 64 bit built Qt. You will have to deploy them to a 64 bit machine to run them.

8 comments

April 25, 2011

Picture of qtuser qtuser

Lab Rat

I am following above mentioned steps but unable to build QT 64bit libraries.
I followed following steps:
1. “32bit cp: Run configure with the options you want” configure -debug-and-release -commercial -shared -no-fast -exceptions -accessibility -no-qt3support -qt-zlib -qt-gif -qt-libpng -qt-libmng -qt-libtiff -qt-libjpeg -no-dsp -no-vcproj -no-incredibuild-xge -plugin-manifests -qmake -process -rtti -no-dbus -no-phonon -webkit -script -scripttools -nomake examples -nomake demos -native-gestures -platform win32-msvc2010
codeinvain.com/blog/378/installing-qt-4-7-x-for-vs2010
Result: Everything runs fine

2. 32bit cp: cd src\tools && nmake (note this will fail at the uic3 step, this is fine)
Result: NMAKE : fatal error U1064: MAKEFILE not found and no target specified

3. 64bit cp: cd src && nmake (note this will fail at the uic3 step, again this is fine)
Result: NMAKE : fatal error U1064: MAKEFILE not found and no target specified

4. 64bit cp: cd src\tools\uic3 && qmake
Result: No Error

*5. 64bit cp: cd src && nmake *
Result: NMAKE : fatal error U1064: MAKEFILE not found and no target specified

Am I missing something or is their some issue with the parameters that were supplied while running configure.exe?

Thanks

August 15, 2011

Picture of cuyan cuyan

Lab Rat

labrat,

Yes, you are missing the MAKEFILE as the error says. In order to create it, you must invoke the configure command from the Visual Studio command prompt as follows (e.g. : for Visual Studio 2010)

> configure -platform win32-msvc2010

January 22, 2012

Picture of espakm espakm

Lab Rat

Hi,
I ran into the same problem.
The -platform option is there, it was there for “qt user”, too.
There is a Makefile in other folders like the source root or the “tools” folder, but not in the “src\tools” where the uic3 is.
What is the trick?

March 3, 2012

Picture of George Edison George Edison

Lab Rat

I believe I have finally come up with a way to do this – it is quite tedious but it works. The details are too lengthy to list here, so I will instead refer you to this answer:

http://stackoverflow.com/a/9543758/193619 [stackoverflow.com]

The end result is the 64-bit DLLs in the ‘lib’ folder.

March 3, 2012

Picture of espakm espakm

Lab Rat

No, I did not find the solution. I ended up with building the 32 and 64 bit Qt on a 64 bit Windows. That was easier.
Thanks anyway! This will be useful for others.

December 4, 2012

Picture of marco.stanzani marco.stanzani

Lab Rat

hello
i am running qt 4.8.1 and MSVC++ 2008 on a 64 bit win7 computer. Since my application relies on some libs and dlls compiled for a 32 bit machine and I want to get the qt libraries for 32 its i am running from MSVC command prompt the following

nmake clean
configure -debug-and-release -opensource -shared -no-qt3support -qt-sql-sqlite -no-webkit -no-script -platform win32-msvc2008
nmake

all of this ran smoothly.

If I look at the MSVC project files I see the linker relies on the $(QTDIR)/lib and I see QTDIR is currently set at c:\qt\4.8.1 and lib files qtcore.dll, lib etc. are correcly there

I then open my MSVC solution with win32 configuration and I got the error ‘There is no Qt version assigned to this project for platform Win32’ …
If I create a new x64 configuration I can compile the program but of course I cannot link my thrid-party lib files

please help: I probably miss some obvious steps or I do not fully understand the 32-64 bit dilemma

one more question: what hould I do to maintan both 32 bit and 64 bit Qt? It looks like they are compiled in the same $(QTDIR)/lib directry. should I manually rename the directories and redefine the QTDIR env variable? I was figuring out this is handled smoothly by the installation process

thanks much to who’ll help me on this

December 4, 2012

Picture of marco.stanzani marco.stanzani

Lab Rat

bottom line: I’d like to build and maintain 32 bit Qt projects on a 64 bit machine :)

May 16, 2013

Picture of nomhoi nomhoi

Lab Rat

qtuser,

2 and 3 steps: run qmake before nmake.

Write a comment

Sorry, you must be logged in to post a comment.