[Qt-interest] Building Qt for 64bits Windows

Dario Ahdoot dario.ahdoot at image-metrics.com
Thu Jul 2 00:02:48 CEST 2009


This is tricker than it seems initially if you are on a 32-bit machine and trying to cross compile. This is because the compiler will first create moc, uic, and rcc as 64-bit executables, which won't run on your 32-bit machine, meaning you won't be able to build the rest of the Qt libs. I haven't found a way arounds this. The only way I can think of is to build those three, halt build, copy them out into some temp folder and copy the 32 bit versions you may already have built back in, build the rest of Qt, then copy the 64-bit versions back in. I haven't tried this, but it seems like an ugly and time consuming hack.

I posted about this on here before and read through the archives but wasn't able to get a sufficient answer. If somebody has one, I would love to hear it.

D

-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Constantin Makshin
Sent: Wednesday, July 01, 2009 12:34 PM
To: Qt-interest
Subject: Re: [Qt-interest] Building Qt for 64bits Windows

Visual Studio IDE compiles for Win32 platform by default. Create "x64"  
platform for your project and try to compile again.

On Wed, 01 Jul 2009 16:25:59 +0400, Yves Bailly <yves.bailly at sescoi.fr>  
wrote:
> Matthieu Dazy wrote:
>> Yves Bailly wrote:
>>> Just a pair of questions about 64bits on Windows and Qt 4.5.2.
>>> 1) In the "mkspecs", I only see "win32-*" folders... are they suitable
>>>    for building Qt using Visual 2008 64bits compiler? If so, how to
>>>    specifie I want to use the 64bits compiler instead of the default
>>>    32bits compiler?
>>
>> Yes, the win32 mkspecs are the correct ones.
>>
>> Assuming you're using Visual Studio, in order to use the 64-bit
>> compiler, just run path_to_visual_studio\vc\bin\amd64\vcvarsamd64.bat
>> instead of path_to_visual_studio\vc\bin\vcvars32.bat when setting up the
>> compiler environment and tools.
>
> Thanks Matthieu.
>
> After some testing, it seems Qt is build in 64bits mode... but when I  
> load
> a project file in Visual Studio (e.g.  
> examples/tutorials/adressbook/part1/
> part1.vcproj), it complains when linking with QtGui4.lib , saying "module
> machine 'x64' conflicts with target machine type 'X86'".
>
> So if I understand correctly, it seems the *.vcproj project files are not
> created correctly, or at least they do not contain the needed information
> to build/link for 64bits target.
>
> Or am I missing something?
>
> Regards,

-- 
Constantin "Dinosaur" Makshin
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list