qt5.6 macdeployqt creates broken paths for Helpers like QtWebEngineProcess



  • Hello all,

    I'm using the brew version of Qt5.6. When I run macdeployqt MyApp.app, I seem to get all the frameworks and libraries linked correctly.

    However, if I move the MyApp.app file to a different Mac where qt is not installed, I get errors running the app.

    Running otool -L /Applications/MyApp.app/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess returns this:

    /usr/local/Cellar/qt5/5.6.0/lib/QtWebEngineCore.framework/Versions/5/QtWebEngineCore
    /usr/local/Cellar/qt5/5.6.0/lib/QtQuick.framework/Versions/5/QtQuick (compatibility version 5.6.0, current version 5.6.0)
    /usr/local/Cellar/qt5/5.6.0/lib/QtGui.framework/Versions/5/QtGui (compatibility version 5.6.0, current version 5.6.0)
    /usr/local/Cellar/qt5/5.6.0/lib/QtQml.framework/Versions/5/QtQml (compatibility version 5.6.0, current version 5.6.0)
    /usr/local/Cellar/qt5/5.6.0/lib/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.6.0, current version 5.6.0)
    /usr/local/Cellar/qt5/5.6.0/lib/QtWebChannel.framework/Versions/5/QtWebChannel (compatibility version 5.6.0, current version 5.6.0)
    /usr/local/Cellar/qt5/5.6.0/lib/QtPositioning.framework/Versions/5/QtPositioning (compatibility version 5.6.0, current version 5.6.0)
    /usr/local/Cellar/qt5/5.6.0/lib/QtCore.framework/Versions/5/QtCore (compatibility version 5.6.0, current version 5.6.0)
    /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    

    Instead of referencing the package's versions of QtWebEngineCore, it references the installed versions in /usr/local/Cellar/qt5/5.6.0 (that won't exist on a different machine) and promptly crashes.

    I've played around with install_name_tool, but can't get it to work correctly. And advice here is appreciated.

    Addendum:
    I've tried to run the following script (in the QtWebEngineProcess Helpers directory) :
    sudo install_name_tool -add_rpath "/Applications/MyApp.app/Contents/Frameworks/" QtWebEngineProcess
    sudo install_name_tool -change "/usr/local/Cellar/qt5/5.6.0/lib/QtWebEngineCore.framework/Versions/5/QtWebEngineCore" "@rpath/QtWebEngineCore.framework/Versions/5/QtWebEngineCore" QtWebEngineProcess
    ... for each broken link.
    However, now when I try to run my app I get the error of:
    dyld: Library not loaded: @executable_path/../Frameworks/QtQuick.framework/Versions/5/QtQuick Referenced from: /Applications/MyApp.app/Contents/Frameworks//QtWebEngineCore.framework/Versions/5/QtWebEngineCore Reason: image not found


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.