PDA

View Full Version : Compiling 64-bit Code



Atomic_Sheep
22nd April 2013, 11:12
Hi, I'm trying to compile some 64-bit code and wouldn't know where to begin. I'm using Qt Creator 2.2.0 - based on Qt 4.7.4 (32 bit). I tried simply changing win32 to win64 in the .pro file but looks like win64 doesn't exist. What needs to be done to compile 64 bit code?

NormanDunbar
22nd April 2013, 11:32
Morning Atomic_Sheep,

while 64 bit systems can install and run 32 bit applications quite happily, the reverse is not true. If your system is 32 bit then you cannot compile 64 bit code as the whole environment, including Qt Creator, will need to be running as 64 bit. Even if your system is 64 bit, you cannot - as far as I am aware - compile 32 bit unless you have installed a suitable compiler toolchain, and configured Qt Creator with a 32 bit compiler.

On my Linux 64 bit laptop, I can go to tools->options, select Build & Run, and in there I see two auto-detected compilers, GCC 64 bit and GCC 32 bit. Windows might be different of course.

When you put "win32" in the pro file, you are telling the build system that "qmake will run in win32 mode. In this mode, Windows file naming and path conventions will be used, additionally testing for win32 (as a scope) will succeed. This is the default mode on Windows." (From the Qmake manual.)

HTH

Cheers,
Norm.