我目前正在尝试在 MacOs 上部署我的 Qt5.8 应用程序。Travis 的最新工作在这里。使用后我得到了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 env 上的绝对路径。
我应该怎么做才能部署 Qt 应用程序?非常感谢!