[Qt-interest] Qt SDK 4.6 on OS X 10.6: Compile 64bit possible?
Oliver.Knoll at comit.ch
Oliver.Knoll at comit.ch
Tue Dec 8 12:13:19 CET 2009
Richard wrote on Tuesday, December 08, 2009 10:12 AM:
>> ... my first basic question (before I come up
>> with new ones): Is it possible to build 64 bit applications when
>> using the pre-compiled Qt SDK based on Qt 4.6 (the latest one) (on
>> Mac OS
>> 10.6, for that matter)?
> The SDK ships with Qt Creator, which is 'deployed', meaning it
> contains its own version of Qt regardless of what version of Qt you
> end up installing/uninstalling on your system.
Oh I see - that explains why I still saw "Based on Qt 4.6 *32 bit*" in the Creator info dialog - and why it was still running, even after I had replaced the Qt "Carbon" version from the SDK with the binary "Cocoa" version.
> In addition, the SDK
> installs a carbon version of Qt on your system (universal: i386 and
> ppc).
Ah thanks for the confirmation. Somehow I had the impression that given the Qt SDK download size of 631 MB (vs only 283 MB for Windows and 444 MB for Linux) that it would contain different Qt versions - Cocoa and Carbon - and that I was just too blind to see the switch. Also the
http://labs.trolltech.com/blogs/2009/08/31/qt-46-on-mac-os-106/
seemed to support my assumption: "Qt follows suit and is also 64-bit by default when building for Cocoa (Select this with the -cocoa flag at the configure line or use the -arch x86_64 flag)."
Off course this leaves the question open whether the current Qt SDK was compiled with the -cocoa flag or not. Obviously it is not, as you have just confirmed.
I was desperatelly looking for this information ("How is the SDK compiled") and similar questions also sometimes pops up for the Windows SDK ("Which C++ runtime is used?" etc.). Is this ("How is the SDK compiled") somewhere described on or linked from e.g.
http://qt.nokia.com/downloads/sdk-mac-os-cpp ?
That would be very helpful.
> If you would like to develop 64-bit applications, just
> uninstall Qt (/Developer/Tools/uninstall_qt.py), and install the
> cocoa version instead.
That's exactly what I did in the end ;)
> This will not affect Qt Creator in any way
> (which itself be unistalled with
> /Developer/Tools/uninstall_qtsdk.py).
I remember at one stage I still had a "-arch x86 [...] -arch x86_64 -Xarch x86_64" (both 32bit and 64bit, which then conflicted at link stage with the 64bit only exiv2 library) on the compiler/linker line (even with an explicit CONFIG -= x86 ppc). But I think this probably was still a bug from the original Qt 4.5.3 which I had installed previously.
Anyway, when I really made sure that all directories from Qt 4.5.3 were deleted (especially the mkspecs) and re-installed the binary Cocoa Qt 4.6 everything was fine: I just had the expected -arch_64 -Xarch86_64" on the linker line and everything linked just fine. I don't know what really caused this mess initially, and since it worked in the end, I did not bother too much ;)
> You can only have one version of Qt installed at a time when using
> the _binary_ package. If you want both the Carbon and the Cocoa port
> awailable at the same time, you need to build at least one of them
> from sources yourself.
Thanks for this additional information. For now I only bother about "Cocoa 64bit" (that is, I just want to make my app run on what *I* have - I care about deployment much later ;)
One last question, out of curiosity: I am not yet familiar with "Frameworks", but I understand that the "Cocoa" port supports both 32bit and 64bit applications. Does that mean that there are two distinct libraries lying around "somewhere" for e.g. QtCore? Are they both under /Library/Frameworks/Qt/... (can't remember the exact path right now), something like QtCore32.dynlib and QtCore64.dynlib (names made up by me)? And when deploying my app I also have to make sure which Qt library files to ship along?
A simple link and a "Read this!" would also be helpful. Currently I am a bit overhelmed by the documenation found on e.g. http://developer.apple.com/mac/library/navigation/index.html#topic=Guides§ion=Resource+Types ;)
Or is everything been taken care of by the http://doc.trolltech.com/4.6/deployment-mac.html#macdeploy in the end? :)
Thank you,
Oliver
--
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22
More information about the Qt-interest-old
mailing list