[Kde-bindings] Re: Notes on building on Mac OS X

Ben Skelton ben.skelton at chestnut-tree-cafe.org
Fri Feb 18 16:33:33 UTC 2011


My QAccessibleBridgePlugin problem seems taken care of with a change to qtcore/tests/test.cpp:

> #ifdef TEST_QT_NO_ACCESSIBILITY
> #include "QtGui/qaccessible.h"
> #include "QtGui/qaccessiblebridge.h"
> 
> int main(int argc, char ** argv)
> {
>   QAccessibleEvent event(QEvent::AccessibilityHelp, 0);
>   QAccessibleBridgePlugin plugin(0);
> }
> 
> #endif


which just leaves:

> [ 42%] Building CXX object qtgui/CMakeFiles/smokeqtgui.dir/x_20.cpp.o
> Linking CXX shared library libsmokeqtgui.dylib
> Undefined symbols:
>   "QMenu::macMenu(void*)", referenced from:
>       __smokeqtgui::x_QMenu::x_45(Smoke::StackItem*)      in x_10.cpp.o
>       __smokeqtgui::x_QMenu::x_77(Smoke::StackItem*)      in x_10.cpp.o
>   "qt_mac_set_cursor(QCursor const*, QPoint const&)", referenced from:
>       __smokeqtgui::x_QGlobalSpace::x_445(Smoke::StackItem*)       in x_20.cpp.o
> ld: symbol(s) not found


> Kauri:~ benskelton$ otool -tV /Users/benskelton/Desktop/build/lib/libQtGui.dylib | c++filt | grep macMenu

> 000000000001568a	callq	QMenu::macMenu(NSMenu*)
> 0000000000017977	callq	0x006e849c	; symbol stub for: QCoreApplicationPrivate::macMenuBarName()
> QMenuPrivate::macMenu(NSMenu*):
> QMenu::macMenu(NSMenu*):
> 0000000000066359	jmp	QMenuPrivate::macMenu(NSMenu*)
> 0000000000066c38	callq	QMenu::macMenu(NSMenu*)
> 0000000000067796	callq	QMenu::macMenu(NSMenu*)
> 0000000000067961	callq	QMenu::macMenu(NSMenu*)
> QMenuBarPrivate::macMenu():
> QMenuBar::macMenu():
> 0000000000068159	jmp	QMenuBarPrivate::macMenu()
> 000000000006842f	callq	QMenuBar::macMenu()
> 00000000000686d2	callq	QMenuBar::macMenu()
> 0000000000068a8b	callq	QMenuPrivate::macMenu(NSMenu*)

Looking at the comments in the Qt source for macMenu:

>     If Qt is built against Carbon, the OSMenuRef is a MenuRef that can be used
>     with Carbon's Menu Manager API.
> 
>     If Qt is built against Cocoa, the OSMenuRef is a NSMenu pointer.

otool shows an NSMenu* argument because my Qt is built for Cocoa. It appears that Qt sets QT_MAC_USE_COCOA for Cocoa builds and does not set this for Carbon builds. Qt documentation says that Cocoa builds are default for Qt/Mac.

When I run cmake it sets the QT_MAC_USE_COCOA define:

> -- Looking for QT_MAC_USE_COCOA - found
>> 

But my qtdefines does not have this - is this a problem?:

> Kauri:smokeqt benskelton$ grep COCOA qtdefines 
> Kauri:smokeqt benskelton$ 


> Kauri:~ benskelton$ otool -tV /Users/benskelton/Desktop/build/lib/libQtGui.dylib | c++filt | grep qt_mac_set_cursor
> qt_mac_set_cursor(QCursor const*, QPoint const&):

which seems ok, right? Not sure if this is relevant in some way, but in the Qt source this function does nothing for the default case on the mac:

> void qt_mac_set_cursor(const QCursor *c, const QPoint &)
> {
> #ifdef QT_MAC_USE_COCOA
>     Q_UNUSED(c);
>     return;
> #else

Sorry for all the naive questions. I hope somebody with some knowledge can see something here.

cheers,
--Ben


On 18 Feb 2011, at 22:39, Ian Monroe wrote:

> On Fri, Feb 18, 2011 at 08:37, Arno Rehn <arno at arnorehn.de> wrote:
>> On Friday 18 February 2011 15:31:12 Adam Higuera wrote:
>>> I managed to build the Qt bindings on Mac OS X with the frameworks from
>>> Nokia.  A record of my misadventures should be in the list archives
>>> somewhere.  I wound up patching smokegen to get it to find the framework
>>> headers, if I recall correctly.
>> Do you still have the patches around? I'd really like to get OS X support into
>> the repo.
> 
> Whats up with the Mac and Windows people patching their local copies
> to get it to build and then disappearing...
> _______________________________________________
> Kde-bindings mailing list
> Kde-bindings at kde.org
> https://mail.kde.org/mailman/listinfo/kde-bindings




More information about the Kde-bindings mailing list