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: -------------------------------------- Process: application [54117] Path: /Temp/application/application.app/Contents/MacOS/application Identifier: com.yourcompany.application Version: ??? (???) Code Type: X86-64 (Native) Parent Process: launchd [87] Date/Time: 2009-02-13 19:40:26.646 +0000 OS Version: Mac OS X 10.5.6 (9G55) Report Version: 6 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Crashed Thread: 0 Application Specific Information: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSApplication qt_qcocoamenuLoader]: unrecognized selector sent to instance 0x10133d4b0' Thread 0 Crashed: 0 libSystem.B.dylib 0x00007fff8058fec6 __kill + 10 1 libstdc++.6.dylib 0x00007fff8316f085 dyld_stub__Unwind_DeleteException + 0 2 libobjc.A.dylib 0x00007fff81612adf _objc_terminate + 102 3 libstdc++.6.dylib 0x00007fff8316d425 __gxx_personality_v0 + 1259 4 libstdc++.6.dylib 0x00007fff8316d45b std::terminate() + 19 5 libstdc++.6.dylib 0x00007fff8316d54c __cxa_rethrow + 0 6 libobjc.A.dylib 0x00007fff81612966 objc_exception_rethrow + 0 7 com.apple.CoreFoundation 0x00007fff841985fb -[NSObject doesNotRecognizeSelector:] + 171 8 com.apple.CoreFoundation 0x00007fff84196c84 ___forwarding___ + 756 9 com.apple.CoreFoundation 0x00007fff84196dd8 _CF_forwarding_prep_0 + 232 10 com.yourcompany.application 0x000000010005fdb1 getMenuLoader() + 33 11 com.yourcompany.application 0x0000000100060d33 createNSMenuItem(QString const&) + 163 12 com.yourcompany.application 0x0000000100063346 QMenuBarPrivate::QMacMenuBarPrivate::addAction(QMacMenuAction*, QMacMenuAction*) + 220 13 com.yourcompany.application 0x00000001000634e3 QMenuBarPrivate::QMacMenuBarPrivate::addAction(QAction*, QMacMenuAction*) + 133 14 com.yourcompany.application 0x00000001000637e5 QMenuBarPrivate::macMenu() + 763 15 com.yourcompany.application 0x000000010006387b QMenuBar::macMenu() + 29 16 com.yourcompany.application 0x0000000100063aa2 QMenuBar::macUpdateMenuBar() + 548 17 com.yourcompany.application 0x000000010000cd6d onApplicationWindowChangedActivation(QWidget*, bool) + 461 18 com.yourcompany.application 0x000000010002a927 -[QCocoaWindowDelegate windowDidBecomeKey:] + 95 19 com.apple.Foundation 0x00007fff8454e0a0 _nsnote_callback + 112 20 com.apple.CoreFoundation 0x00007fff841005c6 _CFXNotificationPostNotification + 566 21 com.apple.Foundation 0x00007fff8454b356 -[NSNotificationCenter postNotificationName:object:userInfo:] + 102 22 com.apple.AppKit 0x00007fff80da91ec -[NSWindow becomeKeyWindow] + 970 23 com.apple.AppKit 0x00007fff80da897c -[NSWindow _changeKeyAndMainLimitedOK:] + 589 24 com.apple.AppKit 0x00007fff80da865d -[NSWindow makeKeyAndOrderFront:] + 100 25 com.yourcompany.application 0x000000010001bfd0 QWidgetPrivate::show_sys() + 2248 26 com.yourcompany.application 0x00000001000db158 QWidgetPrivate::show_helper() + 618 27 com.yourcompany.application 0x00000001000db79b QWidget::setVisible(bool) + 1373 28 com.yourcompany.application 0x000000010052c57d QWidget::show() + 37 29 com.yourcompany.application 0x0000000100004fa4 main + 82 30 com.yourcompany.application 0x0000000100004f30 start + 52 Thread 0 crashed with X86 Thread State (64-bit): rax: 0x0000000000000000 rbx: 0x00007fff7008f7f8 rcx: 0x00007fff5fbfeca8 rdx: 0x0000000000000000 rdi: 0x000000000000d365 rsi: 0x0000000000000006 rbp: 0x00007fff5fbfecc0 rsp: 0x00007fff5fbfeca8 r8: 0x00007fff5fbfe830 r9: 0x0000000000000000 r10: 0x00007fff80567d76 r11: 0x0000000000000202 r12: 0x00007fff841c0b80 r13: 0x0000000000000000 r14: 0x00007fff8161cd00 r15: 0x00007fff70691060 rip: 0x00007fff8058fec6 rfl: 0x0000000000000202 cr2: 0x000000000080a204 -------------------------------------- Is that something that can easily be fixed/worked around on either my part or your part? Or do we definitely have to go for the frameworks approach now for Cocoa? Many thanks and best regards, Martin Dyde, Milan Digital Audio LLC. http://www.crumhorn-labs.com/ http://www.milandigitalaudio.com/ _______________________________________________ Qt4-preview-feedback mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback
