Results 1 to 4 of 4

Thread: Deploy Qt application on Mac OS X

  1. #1
    Join Date
    Jan 2009
    Location
    Italy
    Posts
    10
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Deploy Qt application on Mac OS X

    Hi!

    I'm trying to deploy my application. I've followed the instruction in http://doc.trolltech.com/4.4/mac-differences.html and with otool I can see this:



    Heisenberg:~/Documents/Works/Project/G-Squared/remote_xreport/bin andrea$ otool -L xreport.app/Contents/MacOS/xreport
    xreport.app/Contents/MacOS/xreport:
    QtScript.framework/Versions/4/QtScript (compatibility version 4.4.0, current version 4.4.3)
    QtSvg.framework/Versions/4/QtSvg (compatibility version 4.4.0, current version 4.4.3)

    but when I try to start this is the error:


    Dyld Error Message:
    Library not loaded: QtScript.framework/Versions/4/QtScript
    Referenced from: /Volumes/andrea/Documents/Works/Project/G-Squared/remote_xreport/bin/xreport.app/Contents/MacOS/xreport
    Reason: image not found

    I've tried with install_name_tool and this is the result!
    Dyld Error Message:
    Library not loaded: @executable_path/../Frameworks/QtScript/Version/4/QtScript

    why????? I don't understand......

    This is the otool -L QtScript output

    xreport.app/Contents/Frameworks/QtScript.framework/Versions/4/QtScript:

    @executable_path/../Frameworks/QtScript.framework/Version/4/QtScript (compatibility version 4.4.0, current version 4.4.3)
    @executable_path/../Frameworks/QtCore/Version/4/QtCore (compatibility version 4.4.0, current version 4.4.3)
    /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.3.11)
    /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)

  2. #2
    Join Date
    Feb 2009
    Location
    ŁÃ³dź, Poland
    Posts
    20
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Deploy Qt application on Mac OS X

    Hey,

    I assume that you want to have dynamically linked libraries in your bundle on purpose. If not, consider compiling statically linked Qt libraries and compile your app using them. You'll find more info on wiki - [WIKI]Building_static_applications[/WIKI].

    Back to the topic. If you want to have QtScript and QtSvg added to your application, the proper way to do this using install_name_tool would be:

    1. make Frameworks dir inside the bundle:
    # cd /Volumes/andrea/Documents/Works/Project/G-Squared/remote_xreport/bin/xreport.app/Contents
    # mkdir Frameworks
    2. copy libraries to Frameworks dir:
    # cp <full_path_to_QtScript_given_by_otool> Frameworks
    # cp <full_path_to_QtSvg_given_by_otool> Frameworks
    3. change library references for your app:
    # install_name_tool -change <full_path_to_QtScript_given_by_otool> Frameworks/QtScript MacOS/xreport
    # install_name_tool -change <full_path_to_QtSvg_given_by_otool> Frameworks/QtSvg MacOS/xreport
    4. Check with otool if library references really changed - they definitely ought to.

    This works perfectly for me. But I really prefer to build an app using statically linked Qt
    Good luck!

  3. #3
    Join Date
    Jan 2009
    Location
    Italy
    Posts
    10
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Deploy Qt application on Mac OS X

    Thanks,

    I've to do the same for Firebird plugin?


    There is a 3rd party software to build bundle application?

    Andrea

  4. #4
    Join Date
    Feb 2009
    Location
    ŁÃ³dź, Poland
    Posts
    20
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Deploy Qt application on Mac OS X

    You should do this for every non-system library that your application links to.

    For a deployment script take a look at this thread:

    http://www.qtcentre.org/forum/f-qt-s...-mac-6861.html
    Last edited by ayoy; 11th February 2009 at 09:36. Reason: updated contents

Similar Threads

  1. Third Party tool for deploy Qt Application on Mac?
    By vishal.chauhan in forum Qt-based Software
    Replies: 6
    Last Post: 10th February 2009, 17:03
  2. dependency file for Qt application to deploy
    By rajeshs in forum Installation and Deployment
    Replies: 5
    Last Post: 11th August 2008, 09:59
  3. Deploy Qt application on Mac OS X 10.4 Tiger
    By mourad in forum Installation and Deployment
    Replies: 1
    Last Post: 30th March 2008, 16:20
  4. dll + application
    By fpujol in forum Qt Programming
    Replies: 11
    Last Post: 15th April 2007, 18:37
  5. My application can't connect to database when deploy it???
    By gtthang in forum Installation and Deployment
    Replies: 1
    Last Post: 15th February 2006, 11:01

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.