Qt World Summit: Register Today!

Portable Qt application for Mac

  • Hi everybody.
    I have just compiled an application on my Mac. On my Mac the application works. Now I want to copy ad use it on another mac without QtSDK installed. On Linux I can use this row "LIBS += -Wl,-rpath=\$$ORIGIN/libs" for define the directory of the required qt libs but on Mac does not works.
    How can I do for define the directory of the required qt libs?

  • Try set it up in application http://doc.qt.nokia.com/4.7-snapshot/qcoreapplication.html#addLibraryPath :


  • I have solved with "plugins" but not with "libs".

    For example: Where must I put the library "QtDeclarative"?
    I have add to application
    Now where I must create the "libs" directory?
    Which are the files to copy in libs from "qtDeclarative.framework" directory?

  • Use full path (you can use QApplication::applicationDirPath() to return full path to your application):

    and there you go.

  • Ok and then where I must create the libs directory? Which is the files that I must put in?
    See the error:

    Dyld Error Message:
    Library not loaded: /Users/USER//QtDeclarative.framework/Versions/4/QtDeclarative
    Reference from: /Users/USER/

  • I think, here:

  • Solved using macdeployqt in QTDIR/bin/

Log in to reply