PDA

View Full Version : Deploying 64bit on 32bit OS



M.
17th November 2009, 19:45
Is it posible to compile Qt application on Windows XP which will run on Windows Vista 64 bit or Windows 7 64bit? I am using Visual Studio 2008 with Qt add-in and Qt 4.5.3 .

scascio
17th November 2009, 20:51
Your question gives me trouble according to the title of your thread.

Anyway, you can compile on a 64bits machine with the right compile option (-m32 for gcc) to generate an executable that will run on 32 bits machine.

ChrisW67
17th November 2009, 21:23
The Microsoft compiler suite should be able to build 64-bit executables on a 32-bit machine but I gather you would first have to build Qt from source using the 64-bit compiler options and then build your project in that environment.

Of course, you will not be able to test, deploy or run the resulting 64-bit executable on your 32-bit machine (which is what your title implies you want).

M.
18th November 2009, 06:03
The Microsoft compiler suite should be able to build 64-bit executables on a 32-bit machine but I gather you would first have to build Qt from source using the 64-bit compiler options and then build your project in that environment.

Of course, you will not be able to test, deploy or run the resulting 64-bit executable on your 32-bit machine (which is what your title implies you want).

And could you share those compiler options? :rolleyes:

ChrisW67
19th November 2009, 06:49
I don't have a full blown VS install, only the Microsoft SDK 6.1 in a 32-bit environment. This seems to do the trick from the Microsoft SDK command prompt:
C:\TEMP>vcvarsx86_amd64.bat
Setting environment for using Microsoft Visual Studio 2008 Beta2 x64 cross tools
.

C:\TEMP>cl main.c
Microsoft (R) C/C++ Optimizing Compiler Version 15.00.21022.08 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

main.c
Microsoft (R) Incremental Linker Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.

/out:main.exe
main.obj

C:\TEMP>The resulting main.exe cannot run on this machine. The batch file (you'd have to dissect yours) tweaks the LIB, LIBPATH, and PATH variables to put the 64-bit cross-compiler and 64-bit libraries in the mix before any others.

I did think the compiler had a "/MACHINE" option to set the target but that appears to be wrong.

yodasoda
23rd April 2010, 19:26
how do you delete a post

yodasoda
23rd April 2010, 19:27
Your question gives me trouble according to the title of your thread.

Anyway, you can compile on a 64bits machine with the right compile option (-m32 for gcc) to generate an executable that will run on 32 bits machine.


Default Re: Deploying 64bit on 32bit OS

what about the dynamic libs though, the application I am building comes with its own qtlibs but since my platform is 64 bits, do I need to provide different libs as well to run on a 32 bit platform?

squidge
23rd April 2010, 22:15
Well yes, your 64-bit libraries will not work in a 32-bit environment, just like your code.