[Qt-qml] How to macdeployqt QMLViewer.app with gestures plugin?

Tico Ballagas ballagas at gmail.com
Fri Oct 22 03:28:32 CEST 2010


I'm struggling with the same issue now.  I've run 'install_name_tool -change...' for my library, but I'm still running into these issues.  Can you say more about 'each link'.  How do I know when I haven't missed a link, or how do I determine a complete list of the links I need to change.

I tried the following list

install_name_tool -change /Library/Frameworks/QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore desktopTest.app/Contents/MacOs/desktopTest

install_name_tool -change /Library/Frameworks/QtCore.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui desktopTest.app/Contents/MacOs/desktopTest

install_name_tool -change /Library/Frameworks/QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore desktopTest.app/Contents/MacOs/ServerComm/libservercomm.dylib

Where ServerComm/libservercomm.dylib is my custom extension.

The executable loads qml and the extention works fine before I run macdeployqt, but I get the following errors after:
10/21/10 6:14:21 PM	[0x0-0x1197196].com.yourcompany.desktopTest[46361]	objc[46361]: Class QNSImageView is implemented in both [...]/desktopTest.app/Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui and /Library/Frameworks/QtGui.framework/Versions/4/QtGui. One of the two will be used. Which one is undefined.

-Tico

On Oct 14, 2010, at 1:38 PM, <tim.ong at nokia.com> <tim.ong at nokia.com> wrote:

> Doing ‘install_name_tool –change...’ on each link as per your suggestion solved the problem.
> 
> Thanks for the help!
> 
> Tim
> 
> 
> On 10/14/10 10:37 AM, "Ong Timothy Andrew" <tim.ong at nokia.com> wrote:
> 
> Thanks for the info Kai...I’ll try it out.
> 
> 
> On 10/14/10 3:02 AM, "Kai Koehne" <kai.koehne at nokia.com> wrote:
> 
> On 10/12/2010 1:02 AM, Ong Tim (Nokia-MS/MtView) wrote:
> > I’m still stuck. Does anyone know how to manually add imports to the
> > QMLViewer.app application bundle? I feel like I’m close, but can’t get
> > passed these errors.
> 
> You have to:
> 
> 1) Copy the plugins you're interested in from the $QTDIR/imports
> directory into $QTDIR/bin/QMLViewer.app/Contents/MacOS, so that there's e.g.
> 
>   QMLViewer.app/Contents/MacOS/QtWebKit/qmldir
> 
> 2) Fix the references of the import plugin to the Qt frameworks. You can
> fix these by hand using install_name_tool. Something like this should
> work (haven't tested it though):
> 
> install_name_tool -change
> /Users/tiiong/qt/qt/*lib/QtCore.framework/Versions/4/QtCore
> 
> @executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
>           QMLViewer.app/Contents/MacOS/QtWebKit/libqmlwebkitplugin.dylib
> 
> Do the same for the other Qt libraries that the plugin depends on.
> 
> All the glory of fixing the references is also described in
> 
> http://doc.trolltech.com/4.7/deployment-mac.html
> 
> Hope this helps,
> 
> Kai
> 
> 
> > Thanks in advance!
> > Tim
> >
> >
> > On 10/8/10 11:31 AM, "Ong Timothy Andrew" <tim.ong at nokia.com> wrote:
> >
> >     Thought it might be a pathing issue so I ran macdeployqt in the dir
> >     where I build Qt, and still get the same error.
> >
> >         objc[590]: Class QCocoaApplicationDelegate is implemented in
> >         both
> >         */Users/tiiong/qt/qt/*bin/QMLViewer.app/Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui
> >         and */Users/tiiong/qt/qt/*lib/QtGui.framework/Versions/4/QtGui.
> >         One of the two will be used. Which one is undefined.
> >
> >         objc[590]: Class QCocoaWindowCustomThemeFrame is implemented in
> >         both
> >         /Users/tiiong/qt/qt/bin/QMLViewer.app/Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui
> >         and /Users/tiiong/qt/qt/lib/QtGui.framework/Versions/4/QtGui.
> >         One of the two will be used. Which one is undefined.
> >
> >         objc[590]: Class QCocoaToolBarDelegate is implemented in both
> >
> 
> Right, you then also need to fix the shared library paths of the
> >
> >
> >     On 10/8/10 10:42 AM, "Ong Timothy Andrew" <tim.ong at nokia.com> wrote:
> >
> >         When I have “QMLViewer.app/Contents/imports/Qt/labs/gestures”
> >         and then try to run a QML that imports gestures I get a viewer
> >         crash with an error stack that has stuff like:
> >
> >
> >             objc[32086]: Class QCocoaColorPanelDelegate is implemented
> >             in both
> >             /Users/tiiong/qmlapp/Mac_qt_4.7_GESTURES/QMLViewer.app/Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui
> >             and
> >             /Users/tiiong/qt/qt/lib/QtGui.framework/Versions/4/QtGui.
> >             One of the two will be used. Which one is undefined.
> >
> >             objc[32086]: Class QMacSoundDelegate is implemented in both
> >             /Users/tiiong/qmlapp/Mac_qt_4.7_GESTURES/QMLViewer.app/Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui
> >             and
> >             /Users/tiiong/qt/qt/lib/QtGui.framework/Versions/4/QtGui.
> >             One of the two will be used. Which one is undefined.
> >
> >             objc[32086]: Class QCocoaPanel is implemented in both
> >
> >
> >         I can run a QML that doesn’t import gestures just fine.
> >
> >         If I have
> >         “QMLViewer.app/Contents/MacOS/imports/Qt/labs/gestures” I get
> >         “module Qt.labs.gestures not installed”
> >
> >         -to
> >
> >
> >         On 10/8/10 10:07 AM, "Ong Timothy Andrew" <tim.ong at nokia.com> wrote:
> >
> >             Thanks.
> >
> >             Do you know where I should put the imports in the bundle?
> >
> >             I tried:
> >
> >                 * QMLViewer.app/Contents/MacOS/imports/Qt/labs/gestures
> >                 * QMLViewer.app/Contents/Plugins/gestures/
> >                 * QMViewer.app/Contents/imports/Qt/labs/gestures
> >
> >
> >             No love so far...
> >
> >
> >             -to
> >
> >
> >
> >
> >             On 10/8/10 12:24 AM, "ext Kai Koehne" <kai.koehne at nokia.com>
> >             wrote:
> >
> >                 On 10/7/2010 10:09 PM, ext tim.ong at nokia.com wrote:
> >                 >  Hi,
> >                 >
> >                 >
> >                 >  I’m using a mac. I just built Qt from qt.git master
> >                 (d7dd96), and
> >                 >  gesturearea from qml-gesturearea.git master (b826a9).
> >                 >
> >                 >  I copied the gesturearea ‘gestures’ dir in to the qt
> >                 imports/Qt/labs/
> >                 >  dir (replaced the old ‘gestures’ dir).
> >                 >
> >                 >  When I tell Qt Creator to use the QMLViewer in my qt
> >                 bin folder I can
> >                 >  run an app that does “import Qt.labs.gestures 2.0”
> >                 >
> >                 >  However, when I do ‘macdeployqt QMLViewer.app’ and
> >                 then tell Qt Creator
> >                 >  to use that viewer I get:
> >                 >
> >                 >  module "Qt.labs.gestures" is not installed
> >
> >                 Hi,
> >
> >                 It seems that macdeployqt not bundling import plugins
> >                 yet. I created a
> >                 task for this in the bug handler:
> >
> >                 http://bugreports.qt.nokia.com/browse/QTBUG-14342
> >
> >                 Meanwhile, you can copy by hand the needed folders from
> >                 $QTDIR/imports
> >                 into the application bundle.
> >
> >                 Regards
> >
> >                 Kai
> >
> >                 >  import Qt.labs.gestures 2.0
> >                 >
> >                 >  Any ideas how to make this work?
> >                 >
> >                 >  Thanks,
> >                 >  Tim
> >
> >
> >                 --
> >                 Kai Koehne
> >                 Software Engineer
> >                 Nokia, Qt Development Frameworks
> >
> >                 Nokia gate5 GmbH
> >                 Firmensitz: Invalidenstr. 117, 10115 Berlin, Germany
> >                 Registergericht: Amtsgericht Charlottenburg, Berlin: HRB
> >                 106443 B
> >                 Umsatzsteueridentifikationsnummer: DE 812 845 193
> >                 Geschäftsführer: Dr. Michael Halbherr, Karim Tähtivuori
> >                 _______________________________________________
> >                 Qt-qml mailing list
> >                 Qt-qml at trolltech.com
> >                 http://lists.trolltech.com/mailman/listinfo/qt-qml
> >
> >
> >
> >
> 
> 
> --
> Kai Koehne
> Software Engineer
> Nokia, Qt Development Frameworks
> 
> Nokia gate5 GmbH
> Firmensitz: Invalidenstr. 117, 10115 Berlin, Germany
> Registergericht: Amtsgericht Charlottenburg, Berlin: HRB 106443 B
> Umsatzsteueridentifikationsnummer: DE 812 845 193
> Geschäftsführer: Dr. Michael Halbherr, Karim Tähtivuori
> 
> 
> _______________________________________________
> Qt-qml mailing list
> Qt-qml at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-qml

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20101021/1383286f/attachment.html 


More information about the Qt-qml mailing list