[Solved] How to switch architecture from 32bit to 64bit for gcc4.4
I installed gcc4.4 by fink and added it with both ABIs (x86 32bit and 64bit)into Tool Chains,
screen shot [cl.ly]
switched Tool chain into gcc4.4 abi: x86-macros-generic-mach-o-64bit,
screen shot [cl.ly]
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.
4 replies
What kind of system are you targeting?If you are targeting a linux system: Have you tried to use the 64bit linux g++ mkspec?
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
You must log in to post a reply. Not a member yet? Register here!


