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 .
Printable View
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 .
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.
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).
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: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.Code:
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>
I did think the compiler had a "/MACHINE" option to set the target but that appears to be wrong.
how do you delete a post
Well yes, your 64-bit libraries will not work in a 32-bit environment, just like your code.