【发布时间】:2016-08-24 15:49:47
【问题描述】:
我正在使用 Qt Creator 3.6.1 和 Qt 5.6.0 (Clang 7.0 (Apple), 64 bit),在尝试创建应用程序包以进行部署时遇到了一些问题。
注意:应用名称叫bibi
-
Qt Creator在build-bibi-Desktop_Qt_5_6_0_clang_64bit-Release/文件夹下成功生成bibi.app - 此
bibi.app未能在另一台 Mac 上成功链接 Qt -
macdeployqt没有解决问题
以下是详细信息:
在另一台 Mac 上运行 bibi.app 时出现错误截图:
otool
> otool -L build-bibi-Desktop_Qt_5_6_0_clang_64bit-Release/bibi.app/Contents/MacOS/bibi
build-bibi-Desktop_Qt_5_6_0_clang_64bit-Release/bibi.app/Contents/MacOS/bibi:
@rpath/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.6.0, current version 5.6.0)
@rpath/QtGui.framework/Versions/5/QtGui (compatibility version 5.6.0, current version 5.6.0)
@rpath/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)
macdeployqt
> which macdeployqt
/Users/<myusername>/Qt/5.6/clang_64/bin/macdeployqt
> macdeployqt bibi.app
> otool -L bibi.app/Contents/MacOS/bibi
bibi.app/Contents/MacOS/bibi:
@rpath/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.6.0, current version 5.6.0)
@rpath/QtGui.framework/Versions/5/QtGui (compatibility version 5.6.0, current version 5.6.0)
@rpath/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)
树 bibi.app
bibi.app
├── Contents
│ ├── Frameworks
│ │ ├── QtCore.framework
│ │ │ ├── QtCore -> Versions/Current/QtCore
│ │ │ ├── Resources -> Versions/Current/Resources
│ │ │ └── Versions
│ │ │ ├── 5
│ │ │ │ ├── QtCore
│ │ │ │ └── Resources
│ │ │ │ └── Info.plist
│ │ │ └── Current -> 5
│ │ ├── QtDBus.framework
│ │ │ ├── QtDBus -> Versions/Current/QtDBus
│ │ │ ├── Resources -> Versions/Current/Resources
│ │ │ └── Versions
│ │ │ ├── 5
│ │ │ │ ├── QtDBus
│ │ │ │ └── Resources
│ │ │ │ └── Info.plist
│ │ │ └── Current -> 5
│ │ ├── QtGui.framework
│ │ │ ├── QtGui -> Versions/Current/QtGui
│ │ │ ├── Resources -> Versions/Current/Resources
│ │ │ └── Versions
│ │ │ ├── 5
│ │ │ │ ├── QtGui
│ │ │ │ └── Resources
│ │ │ │ └── Info.plist
│ │ │ └── Current -> 5
│ │ ├── QtPrintSupport.framework
│ │ │ ├── QtPrintSupport -> Versions/Current/QtPrintSupport
│ │ │ ├── Resources -> Versions/Current/Resources
│ │ │ └── Versions
│ │ │ ├── 5
│ │ │ │ ├── QtPrintSupport
│ │ │ │ └── Resources
│ │ │ │ └── Info.plist
│ │ │ └── Current -> 5
│ │ └── QtWidgets.framework
│ │ ├── QtWidgets -> Versions/Current/QtWidgets
│ │ ├── Resources -> Versions/Current/Resources
│ │ └── Versions
│ │ ├── 5
│ │ │ ├── QtWidgets
│ │ │ └── Resources
│ │ │ └── Info.plist
│ │ └── Current -> 5
│ ├── Info.plist
│ ├── MacOS
│ │ └── bibi
│ ├── PkgInfo
│ ├── PlugIns
│ │ ├── imageformats
│ │ │ ├── libqdds.dylib
│ │ │ ├── libqgif.dylib
│ │ │ ├── libqicns.dylib
│ │ │ ├── libqico.dylib
│ │ │ ├── libqjpeg.dylib
│ │ │ ├── libqtga.dylib
│ │ │ ├── libqtiff.dylib
│ │ │ ├── libqwbmp.dylib
│ │ │ └── libqwebp.dylib
│ │ ├── platforms
│ │ │ └── libqcocoa.dylib
│ │ └── printsupport
│ │ └── libcocoaprintersupport.dylib
│ └── Resources
│ ├── empty.lproj
│ └── qt.conf
└── Icon\r
38 directories, 32 files
谢谢。
问题已解决
感谢scott,问题解决了。以下是我未能成功创建自包含应用程序包的原因:
-
otool -L没有解析 @rpath,我很困惑,因为它总是返回相同的输出 - 缺乏测试捆绑包是否已经包含所有框架的方法
简而言之,问题可以通过使用Scott的otool-rpath、lsof,或者设置DYLD_PRINT_LIBRARIES和DYLD_PRINT_TO_FILE来解决。而且,我已经写了一个注释here。
【问题讨论】:
标签: macos qt dyld otool macdeployqt