Results 1 to 2 of 2

Thread: Distributing QT application for Mac OS

  1. #1
    Join Date
    May 2007
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Distributing QT application for Mac OS

    I used qt-mac-commercial-src-4.2.2.tar.gz for installing QT.
    I compiled it and installed using commands:

    ./configure -universal -qt-libjpeg -qt-libpng
    make
    sudo make install
    I built my application.

    I explored http://doc.trolltech.com/4.2/deployment-mac.html and run
    script for my emap.app:

    install_name_tool -id @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore
    build/release/emap.app/Contents/Frameworks/QtCore.framework/Versions/4/QtCore
    install_name_tool -id @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui
    build/release/emap.app/Contents/Frameworks/QtGui.framework/Versions/4/QtGui
    install_name_tool -change /usr/local/Trolltech/Qt-4.2.2/lib/QtCore.framework/Versions/4/QtCore
    @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore build/release/emap.app/Contents/MacOS/emap
    install_name_tool -change /usr/local/Trolltech/Qt-4.2.2/lib/QtGui.framework/Versions/4/QtGui
    @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui build/release/emap.app/Contents/MacOS/emap
    install_name_tool -change /usr/local/Trolltech/Qt-4.2.2/lib/QtCore.framework/Versions/4/QtCore
    @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore build/release/emap.app/Contents/Frameworks/QtGui.framework/Versions/4/QtGui
    After this, if i remove QT, program working.

    But if i test with otoo what libraries and frameworks are needed, i
    find out that many additional frameworks and libraries are used by
    application and by Qt frameworks:

    nightmares-computer:~/SVN/19 home$ otool -L ./emap.app/Contents/MacOS/emap
    ./emap.app/Contents/MacOS/emap:
    @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.2.0, current version 4.2.2)
    /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 128.0.0)
    /System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime (compatibility version 1.0.0, current version 5.0.0)
    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 824.41.0)
    @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.2.0, current version 4.2.2)
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 22.0.0)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.6)
    /usr/lib/libiconv.2.dylib (compatibility version 5.0.0, current version 5.0.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
    /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)

    nightmares-computer:~/SVN/19 home$ otool -L ./emap.app/Contents/Frameworks/QtGui.framework/Versions/4/QtGui
    ./emap.app/Contents/Frameworks/QtGui.framework/Versions/4/QtGui:
    @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.2.0, current version 4.2.2)
    /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 128.0.0)
    /System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime (compatibility version 1.0.0, current version 5.0.0)
    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 824.41.0)
    @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.2.0, current version 4.2.2)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.6)
    /usr/lib/libiconv.2.dylib (compatibility version 5.0.0, current version 5.0.0)
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 22.0.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
    /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)

    nightmares-computer:~/SVN/19 home$ otool -L ./emap.app/Contents/Frameworks/QtCore.framework/Versions/4/QtCore
    ./emap.app/Contents/Frameworks/QtCore.framework/Versions/4/QtCore:
    @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.2.0, current version 4.2.2)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.6)
    /usr/lib/libiconv.2.dylib (compatibility version 5.0.0, current version 5.0.0)
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 22.0.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
    /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)

    nightmares-computer:~/SVN/19 home$ otool -L ./emap.app/Contents/Plugins/imageformats/libTiffIO.dylib
    ./emap.app/Contents/Plugins/imageformats/libTiffIO.dylib:
    @executable_path/../Plugins/imageformats/libTiffIO.dylib (compatibility version 1.0.0, current version 1.0.0)
    @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.2.0, current version 4.2.2)
    /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 128.0.0)
    /System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime (compatibility version 1.0.0, current version 63.0.0)
    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 824.34.0)
    @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.2.0, current version 4.2.2)
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 22.0.0)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.3)
    /usr/lib/libiconv.2.dylib (compatibility version 5.0.0, current version 5.0.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
    /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)

    nightmares-computer:~/SVN/19 home$ otool -L ./emap.app/Contents/Plugins/imageformats/libqjpeg.dylib
    ./emap.app/Contents/Plugins/imageformats/libqjpeg.dylib:
    @executable_path/../Plugins/imageformats/libqjpeg.dylib (compatibility version 0.0.0, current version 0.0.0)
    @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.2.0, current version 4.2.2)
    /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 128.0.0)
    /System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime (compatibility version 1.0.0, current version 63.0.0)
    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 824.34.0)
    @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.2.0, current version 4.2.2)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.3)
    /usr/lib/libiconv.2.dylib (compatibility version 5.0.0, current version 5.0.0)
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 22.0.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
    /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
    As i understand, if on client machine will absent any of these
    libraries or frameworks my application will not run?
    For example all these files are needed on target machine in specified
    locations:

    /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
    /System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime
    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
    /usr/lib/libz.1.dylib
    /usr/lib/libSystem.B.dylib
    /usr/lib/libiconv.2.dylib
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
    /usr/lib/libstdc++.6.dylib
    /usr/lib/libgcc_s.1.dylib

    So i also need to include them into bundle and to call
    install_name_tool -change for them? Am i right?

    If include them, in what directories of bundle i must place *.dylib
    files?

    And perhaps some of them also need another frameworks which are not in
    current list? Must i run recursively "otool -L ..." for all
    frameworks, libraries, executables, which are added to my bundle, to detect entire list of
    needed frameworks and dylib to add?

    If this is true, is there some way to automate this process?
    And bundle will have size about 200mb or more. Is it normal for mac
    application?

  2. #2
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Distributing QT application for Mac OS

    Those other dependencies are standard Mac libraries. There is no need to distribute them. The user will have them.

Similar Threads

  1. dll + application
    By fpujol in forum Qt Programming
    Replies: 11
    Last Post: 15th April 2007, 18:37
  2. Replies: 3
    Last Post: 8th December 2006, 18:51

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.