On 2009-02-13 21:27:09 +0100, Martin Dyde <[email protected]> said:
> Hello Trenton & co, > > Background: some time last year, after you released the original > Qt/Cocoa alpha, I spoke to you about using -static -no-framework for Qt > Cocoa builds, since we'd prefer to build it that way (we don't need > plug-ins, it simplifies maintenance for our installer (which is > necessarily quite complex), and, our app does seem to start slightly > faster when Qt is linked statically). I must confess to knowing very > little about Objective-C/Cocoa programming, so please forgive me if > this question is just a result of ignorance on my part. (The new > macdeployqt util does indeed make the build process enormously easier > when using private frameworks -- many thanks for that -- and we'll go > for that approach if we do have to.) > > ./configure -help says: > > "-cocoa ............. Build the Cocoa version of Qt. Note that > -no-framework and -static is not supported with -cocoa. Specifying this > option creates Qt binaries that requires Mac OS X 10.5 or higher." > > ... i.e. that -static and -no-framework aren't officially supported for Cocoa. > > However, you mentioned to me that building with -static and > -no-framework should still work if the $QTDIR/src/gui/mac/qt_menu.nib > bundle (including its contents) was copied as <APP > DIR>/Resources/qt_menu.nib. > > That did indeed work fine with the original alpha releases of Qt/Cocoa > last year, but it no longer seems to work with the recent Qt 4.5/Cocoa > snapshots, e.g. qt-all-commercial-src-4.5.0-snapshot-20090212.tar.gz. > > If I try building Qt with: > > ./configure -prefix $PWD -platform macx-g++ -static -debug-and-release > -no-framework -sdk /Developer/SDKs/MacOSX10.5.sdk -arch x86_64 > > ... Qt builds successfully. However, if I then copy > $QTDIR/src/gui/mac/qt_menu.nib into > $QTDIR/examples/mainwindows/application/application.app/Resources and > then try to run it, I get the following crash: Sorry for the delay in responding. Yes, this was something we found out later. We add categories to some Cocoa classes (namely NSApplication and NSWindow). This is mainly to avoid sub-classing these classes. NSApplication especially since there can only ever be one NSApplication object. We found that with static, the categories are stripped. We didn't spend much time investigating this since we never planned on supporting -static. So, this is the reason for the crash I'm afraid and somewhat shuts tho door on a -static with -cocoa. :-( -- Trenton _______________________________________________ Qt4-preview-feedback mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback
