我正在使用Qt Creator 3.6.1
with Qt 5.6.0 (Clang 7.0 (Apple), 64 bit)
,在尝试创建应用程序包进行部署时遇到了一些问题。
注意:应用名称被称为bibi
Qt Creator
文件夹bibi.app
下成功生成build-bibi-Desktop_Qt_5_6_0_clang_64bit-Release/
- 这
bibi.app
未能在另一台 Mac 上成功链接 Qt macdeployqt
不能解决问题
以下为详细内容:
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)
树比比.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
and来解决问题DYLD_PRINT_TO_FILE
。而且,我在这里写了一个带有详细信息的注释。