PDA

View Full Version : How to configure/build 64-bit applications on Mac?



iraytrace
29th January 2010, 02:19
I don't seem to be able to build a 64bit application on the Mac platform. I have the LGPL qt-sdk-mac-opensource-2010.01.dmg binary package. My qmake *.pro file is as follows:


QT += network opengl
TARGET = SixtyFour
TEMPLATE = app
CONFIG += x86_64

SOURCES += main.cpp\
MainWindow.cpp

HEADERS += MainWindow.h

FORMS += MainWindow.ui

alas, this generates the message:


/Library/Frameworks/QtCore.framework/Headers/qglobal.h:288:2: error: #error "You are building a 64-bit application, but using a 32-bit version of Qt. Check your build configuration."

On Linux and Windows there is a "configure" script/program that allows configuring Qt. However I haven't found where this ends up on theMac. Is there a way to get/configure a 64bit version of Qt for the Mac? Looking at qt.nokia.com/downloads I didn't see any 64bit Mac SDK for download.

jefftee
30th January 2010, 21:52
Hi iraytrace, I had the same problem. The default Mac Qt libraries use the older Carbon libraries for compatibility with Intel 32-bit and PPC Mac systems. The newer Cocoa libraries provide support for only Intel 32/64-bit and from what I read, Qt Carbon libraries will eventually disappear and only the Cocoa builds will be available.

Go to the URL below and download the Cocoa build, uninstall the current Qt, and then install the new Cocoa version:

http://qt.nokia.com/downloads/mac-os-cpp

For your app, if you include the following in the PRO file, you'll get a universal binary that will run on 32-bit or 64-bit mac platforms:

CONFIG += x86 x86_64

Hope that helps,

jthomps