Results 1 to 8 of 8

Thread: Deploying 64bit on 32bit OS

  1. #1
    Join Date
    Nov 2009
    Location
    Lithuania
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Deploying 64bit on 32bit OS

    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 .

  2. #2
    Join Date
    Sep 2009
    Posts
    140
    Thanks
    4
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Deploying 64bit on 32bit OS

    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.

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Deploying 64bit on 32bit OS

    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).

  4. #4
    Join Date
    Nov 2009
    Location
    Lithuania
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Deploying 64bit on 32bit OS

    Quote Originally Posted by ChrisW67 View Post
    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?

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Deploying 64bit on 32bit OS

    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:
    Qt Code:
    1. C:\TEMP>vcvarsx86_amd64.bat
    2. Setting environment for using Microsoft Visual Studio 2008 Beta2 x64 cross tools
    3. .
    4.  
    5. C:\TEMP>cl main.c
    6. Microsoft (R) C/C++ Optimizing Compiler Version 15.00.21022.08 for x64
    7. Copyright (C) Microsoft Corporation. All rights reserved.
    8.  
    9. main.c
    10. Microsoft (R) Incremental Linker Version 9.00.21022.08
    11. Copyright (C) Microsoft Corporation. All rights reserved.
    12.  
    13. /out:main.exe
    14. main.obj
    15.  
    16. C:\TEMP>
    To copy to clipboard, switch view to plain text mode 
    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.

  6. #6
    Join Date
    Dec 2009
    Posts
    29
    Thanks
    2
    Thanked 3 Times in 3 Posts

    Default

    how do you delete a post

  7. #7
    Join Date
    Dec 2009
    Posts
    29
    Thanks
    2
    Thanked 3 Times in 3 Posts

    Default Re: Deploying 64bit on 32bit OS

    Quote Originally Posted by scascio View Post
    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?

  8. #8
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Deploying 64bit on 32bit OS

    Well yes, your 64-bit libraries will not work in a 32-bit environment, just like your code.

Similar Threads

  1. Replies: 2
    Last Post: 17th September 2010, 16:38
  2. Qt 4.6 pr1 on Snow leopard? 64bit vs 32bit question
    By akos.maroy in forum Qt Programming
    Replies: 3
    Last Post: 3rd October 2009, 02:35
  3. Compiling Qt 32bit on 64bit os..
    By tgreaves in forum Newbie
    Replies: 2
    Last Post: 12th March 2009, 13:34

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.