Results 1 to 7 of 7

Thread: Determining if compiling for 32 bit or 64 bit and compiler version.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: Determining if compiling for 32 bit or 64 bit and compiler version.

    You can also use QMAKE_HOST.arch to determine on what architecture you currently run. Or if you define which one to use, can't you use the scope parameter -32 or -64?

  2. The following user says thank you to Lykurg for this useful post:

    drescherjm (20th September 2010)

  3. #2
    Join Date
    Apr 2008
    Location
    Pittsburgh,PA,USA
    Posts
    48
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default Re: Determining if compiling for 32 bit or 64 bit and compiler version.

    Excellent. That solves the issue.. I added message($$QMAKE_HOST.arch) to the pri file and got the expected output in the 32 and 64 bit command prompts.

    X:\64Bit\VC.90\Test\qwt-5.2.1>qmake -r x:\QMakeBased\Libraries\qwt-5.2.1\qwt.pr
    o
    Project MESSAGE: x86_64
    Reading X:/QMakeBased/Libraries/qwt-5.2.1/src/src.pro [X:/64Bit/VC.90/Test/qwt-5
    .2.1/src]
    Project MESSAGE: x86_64
    Project MESSAGE: x86_64
    Project MESSAGE: x86_64

    x:\32Bit\VC.90\Temp\Qwt-5.2.1>qmake -r x:\QMakeBased\Libraries\qwt-5.2.1\qwt.pro
    Project MESSAGE: x86
    Reading X:/QMakeBased/Libraries/qwt-5.2.1/src/src.pro [X:/32Bit/VC.90/Temp/Qwt-5.2.1/src]
    Project MESSAGE: x86
    Project MESSAGE: x86
    Project MESSAGE: x86
    Reading X:/QMakeBased/Libraries/qwt-5.2.1/textengines/textengines.pro [X:/32Bit/VC.90/Temp/Qwt-5.2.
    /textengines]
    Project MESSAGE: x86
    Reading X:/QMakeBased/Libraries/qwt-5.2.1/designer/designer.pro [X:/32Bit/VC.90/Temp/Qwt-5.2.1/desi
    ner]
    Project MESSAGE: x86
    Project MESSAGE: x86
    Project MESSAGE: x86
    Last edited by drescherjm; 20th September 2010 at 20:41.
    John

  4. #3
    Join Date
    Apr 2008
    Location
    Pittsburgh,PA,USA
    Posts
    48
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default Re: Determining if compiling for 32 bit or 64 bit and compiler version.

    The following link helps as well. Since I want to append a suffix if I am running under x86_64.

    http://developer.qt.nokia.com/faq/an...bit_or_a_64_bi
    John

  5. #4
    Join Date
    Apr 2008
    Location
    Pittsburgh,PA,USA
    Posts
    48
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default Re: Determining if compiling for 32 bit or 64 bit and compiler version.

    Thanks again.

    I got it working the way I wanted with the following code:

    DEBUG_SUFFIX =
    RELEASE_SUFFIX =
    COMPILER_STR =
    ARCH_STR =

    win32-msvc2008 {
    COMPILER_STR = _2008
    }
    win32-msvc2005 {
    COMPILER_STR = _2005
    }

    win32 {

    contains(QMAKE_HOST.arch, x86_64):{
    ARCH_STR = _x64
    }

    DEBUG_SUFFIX = _$${COMPILER_STR}$${ARCH_STR}_d
    RELEASE_SUFFIX = _$${COMPILER_STR}$${ARCH_STR}_

    }

    Now I can update my cmake qwt finder to use the naming convention (similar to what I use in CMake).

    BTW, the reason for this is I build in both 32 and 64 bit versions and 2 compilers. With this naming scheme I can have 1 lib folder for each project as part of the install and not worry about the 64 bit version trashing the 32 bit version. I hope I explained that well enough..
    Last edited by drescherjm; 21st September 2010 at 00:18.
    John

Similar Threads

  1. Compiling & using Crypto++ with mingw version of Qt
    By FS Lover in forum Qt Programming
    Replies: 14
    Last Post: 16th January 2018, 11:29
  2. compiling Qt 4.4.3 with intel compiler in windows
    By hammer256 in forum Installation and Deployment
    Replies: 0
    Last Post: 13th February 2009, 21:33
  3. How to determine the compiler-version (GCC) ?
    By Comer352l in forum Qt Programming
    Replies: 1
    Last Post: 2nd January 2009, 19:55
  4. How to specify compiler version in project file
    By mdecandia in forum Qt Programming
    Replies: 2
    Last Post: 18th May 2007, 11:03
  5. Compiling custom Qt3 Widgets Gives warning in VC++6 Compiler
    By sunil.thaha in forum Qt Programming
    Replies: 4
    Last Post: 9th June 2006, 12:44

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
  •  
Qt is a trademark of The Qt Company.