我目前正在尝试在MacOs上部署我的Qt5.8应用。最新的Travis工作是here。使用VNote.dmg
后,我收到了macdeployqt
个文件。然后我将其复制到另一台MacOS并尝试运行它,但出现以下错误:
/Applications/VNote/VNote.app/Contents/MacOS/VNote ; exit;
dyld: Library not loaded: /usr/local/Cellar/qt5/5.8.0_1/lib/QtWebEngineCore.framework/Versions/5/QtWebEngineCore
Referenced from: /Applications/VNote/VNote.app/Contents/Frameworks/QtWebEngineWidgets.framework/Versions/5/QtWebEngineWidgets
Reason: image not found
Trace/BPT trap: 5
logout
然后我使用otool -L /Applications/VNote.app/Contents/MacOS/VNote
来获取输出:
/Applications/VNote.app/Contents/MacOS/VNote:
@executable_path/../Frameworks/QtWebEngineWidgets.framework/Versions/5/QtWebEngineWidgets (compatibility version 5.8.0, current version 5.8.0)
@executable_path/../Frameworks/QtWebEngineCore.framework/Versions/5/QtWebEngineCore (compatibility version 5.8.0, current version 5.8.0)
@executable_path/../Frameworks/QtQuick.framework/Versions/5/QtQuick (compatibility version 5.8.0, current version 5.8.0)
@executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.8.0, current version 5.8.0)
@executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.8.0, current version 5.8.0)
/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
@executable_path/../Frameworks/QtQml.framework/Versions/5/QtQml (compatibility version 5.8.0, current version 5.8.0)
@executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.8.0, current version 5.8.0)
@executable_path/../Frameworks/QtWebChannel.framework/Versions/5/QtWebChannel (compatibility version 5.8.0, current version 5.8.0)
@executable_path/../Frameworks/QtPositioning.framework/Versions/5/QtPositioning (compatibility version 5.8.0, current version 5.8.0)
@executable_path/../Frameworks/QtPrintSupport.framework/Versions/5/QtPrintSupport (compatibility version 5.8.0, current version 5.8.0)
@executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.8.0, current version 5.8.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 307.4.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
然后otool -L /Applications/VNote.app/Contents/Frameworks/QtWebEngineWidgets.framework/Versions/5/QtWebEngineWidgets
显示:
/Applications/VNote.app/Contents/Frameworks/QtWebEngineWidgets.framework/Versions/5/QtWebEngineWidgets:
@executable_path/../Frameworks/QtWebEngineWidgets.framework/Versions/5/QtWebEngineWidgets (compatibility version 5.8.0, current version 5.8.0)
/usr/local/Cellar/qt5/5.8.0_1/lib/QtWebEngineCore.framework/Versions/5/QtWebEngineCore (compatibility version 5.8.0, current version 5.8.0)
/usr/local/Cellar/qt5/5.8.0_1/lib/QtQuick.framework/Versions/5/QtQuick (compatibility version 5.8.0, current version 5.8.0)
/usr/local/Cellar/qt5/5.8.0_1/lib/QtGui.framework/Versions/5/QtGui (compatibility version 5.8.0, current version 5.8.0)
/usr/local/Cellar/qt5/5.8.0_1/lib/QtCore.framework/Versions/5/QtCore (compatibility version 5.8.0, current version 5.8.0)
/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/usr/local/Cellar/qt5/5.8.0_1/lib/QtQml.framework/Versions/5/QtQml (compatibility version 5.8.0, current version 5.8.0)
/usr/local/Cellar/qt5/5.8.0_1/lib/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.8.0, current version 5.8.0)
/usr/local/Cellar/qt5/5.8.0_1/lib/QtWebChannel.framework/Versions/5/QtWebChannel (compatibility version 5.8.0, current version 5.8.0)
/usr/local/Cellar/qt5/5.8.0_1/lib/QtPositioning.framework/Versions/5/QtPositioning (compatibility version 5.8.0, current version 5.8.0)
/usr/local/Cellar/qt5/5.8.0_1/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport (compatibility version 5.8.0, current version 5.8.0)
/usr/local/Cellar/qt5/5.8.0_1/lib/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.8.0, current version 5.8.0)
/usr/local/Cellar/qt5/5.8.0_1/lib/QtQuickWidgets.framework/Versions/5/QtQuickWidgets (compatibility version 5.8.0, current version 5.8.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 307.4.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
QtWebEngineWidgets
似乎仍然引用Travis环境的绝对路径。
我应该如何部署Qt应用程序?非常感谢!
答案 0 :(得分:2)
我认为这是macdeployqt
的错误。它似乎无法修复所有框架的依赖关系。相反,它只是修复了可执行文件的直接依赖关系。
感谢macdeployqtfix,这是一个可以忘记macdeployqt
所有事情的工具。
顺便说一句,如果您的应用使用QWebEngineWidget
,则还需要macdeployqt
帮助QWebEngineProcess
捆绑包。