Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] How to switch architecture from 32bit to 64bit for gcc4.4
QtWS25 Last Chance

[Solved] How to switch architecture from 32bit to 64bit for gcc4.4

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 5.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    augiekim
    wrote on last edited by
    #1

    I installed gcc4.4 by fink and added it with both ABIs (x86 32bit and 64bit)into Tool Chains,
    "screen shot":http://cl.ly/1Y2j2S0v1r39461l2a0a
    switched Tool chain into gcc4.4 abi: x86-macros-generic-mach-o-64bit,
    "screen shot":http://cl.ly/1r1u1Z1j2N3t3m1C1c1X

    and added

    @QMAKE_CC = gcc-4
    QMAKE_CXX = g++-4
    QMAKE_LINK = g++-4
    QMAKE_CXXFLAGS += -std=c++0x
    @
    into my .prj file

    but the linker shows an error
    @ld: symbol(s) not found for architecture i386@

    And I think it is because my gcc4.4 is still compiling codes to 32bit binary and it shows the error.
    Because my project uses some dylibs that are compiled for 64bit only, it should be compiled with 64bit option.

    Is there any more thing that I should do to be compiled with 64bit mode?

    I'm trying to do this on Mac OS X.
    Thank you.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      Which mkspec do you end up using?

      With Qt Creator 2.2.x uses tool chains only to track what tools to use and does not automatically switch the mkspecs when changing the compiler. So you might still be using the 32bit mkspec.

      Qt Creator 2.3 does switch the mkspecs if it knows which ones to use.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        augiekim
        wrote on last edited by
        #3

        Thank you Tobias,
        My Qt Creator is 2.2.1.
        I switched mkspecs and now the gcc 4.4 doesn't accept 64 bit arch option..

        @
        :-1: error: unrecognized option '-Xarch_x86_64'
        @

        I think the -Xarch_x86_64 flag does not work on GNU gcc compiler but Apple's.
        I should modify more makespec file but I don't know how.

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tobias.hunger
          wrote on last edited by
          #4

          What kind of system are you targeting?

          If you are targeting a linux system: Have you tried to use the 64bit linux g++ mkspec?

          1 Reply Last reply
          0
          • A Offline
            A Offline
            augiekim
            wrote on last edited by
            #5

            [quote author="Tobias Hunger" date="1311528408"]What kind of system are you targeting?

            If you are targeting a linux system: Have you tried to use the 64bit linux g++ mkspec?[/quote]

            It's Mac OSX 10.6.
            I've just succeeded to compile my codes.
            I made a new mkspecs named mac-g++-4 form existing mac-g++ and modified few lines by switching -arch x86_64 and -XArch_x86_64 into -m64

            @
            QMAKE_CFLAGS_X86_64 += -m64 -mmacosx-version-min=10.5
            QMAKE_OBJECTIVE_CFLAGS_X86_64 += -m64 -mmacosx-version-min=10.5
            ....
            QMAKE_CXXFLAGS_X86_64 += -m64 -mmacosx-version-min=10.5
            QMAKE_CXXFLAGS_X86 += -m32
            @

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved