求助,Mac上无法发布QT工程

zhangbai1000 2017-03-10 04:57:11
开发环境:QT5.8.0
界面工具:QT—Creator
操作系统:MacOS 10.11
问题描述:
1.我新建了一个Widgets的空白工程—“Hello”,打开后就显示一个界面的那种
2.在本机编译成功后,可以直接运行
3.当我直接使用macdeployqt命令对Hello.app进行发布,该APP就无法打开了
4.使用tool -L 命令查找到相关的库后,进行拷贝,并且使用instll_name_tool -change修改链接,操作如下图所示

secutechdeMini:build-hello-Desktop_Qt_5_8_0_clang_64bit-Release secutech$ otool -L hello.app/Contents/MacOS/hello
hello.app/Contents/MacOS/hello:
@rpath/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.8.0, current version 5.8.0)
@rpath/QtGui.framework/Versions/5/QtGui (compatibility version 5.8.0, current version 5.8.0)
@rpath/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)
/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)



secutechdeMini:build-hello-Desktop_Qt_5_8_0_clang_64bit-Release secutech$ mkdir hello.app/Contents/dylib
secutechdeMini:build-hello-Desktop_Qt_5_8_0_clang_64bit-Release secutech$ cp /usr/lib/libc++.1.dylib hello.app/Contents/dylib/
secutechdeMini:build-hello-Desktop_Qt_5_8_0_clang_64bit-Release secutech$ cp /usr/lib/libSystem.B.dylib hello.app/Contents/dylib/
secutechdeMini:build-hello-Desktop_Qt_5_8_0_clang_64bit-Release secutech$ install_name_tool -change /usr/lib/libc++.1.dylib "hello.app/Contents/MacOS/hello"
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool [-change old new] ... [-rpath old new] ... [-add_rpath new] ... [-delete_rpath old] ... [-id name] input
secutechdeMini:build-hello-Desktop_Qt_5_8_0_clang_64bit-Release secutech$ install_name_tool -change /usr/lib/libSystem.B.dylib "hello.app/Contents/MacOS/hello"
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool [-change old new] ... [-rpath old new] ... [-add_rpath new] ... [-delete_rpath old] ... [-id name] input
secutechdeMini:build-hello-Desktop_Qt_5_8_0_clang_64bit-Release secutech$


注:该死的Mac不让我上传网页图片,真TM坑...
5.报错信息如下所示:

Logical CPU: 0
Error Code: 0x02000170
Trap Number: 133


Binary Images:
0x100e70000 - 0x100e73ff3 +com.eSecuTech.hello (0) <C6A0AED4-9034-30DE-B7BD-2F4B238E7604> /Users/USER/Desktop/*/hello.app/Contents/MacOS/hello
0x100e7c000 - 0x1012e0fff +org.qt-project.QtWidgets (5.8 - 5.8.0) <751070F0-6091-3A9C-8B6F-31C363B69435> /Users/USER/Desktop/*/hello.app/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets
0x101442000 - 0x101843fef +org.qt-project.QtGui (5.8 - 5.8.0) <D5482DD8-C913-3074-BAF5-C43A6E335247> /Users/USER/Desktop/*/hello.app/Contents/Frameworks/QtGui.framework/Versions/5/QtGui
0x10193a000 - 0x101df7fff +org.qt-project.QtCore (5.8 - 5.8.0) <2C2FCD3B-2BCA-3941-B85E-9F334EB73FF8> /Users/USER/Desktop/*/hello.app/Contents/Frameworks/QtCore.framework/Versions/5/QtCore
0x101eaa000 - 0x101eaefff com.apple.agl (3.3.1 - AGL-3.3.1) <4E401980-0F4F-33E2-A0CF-8C7CCF375F24> /System/Library/Frameworks/AGL.framework/Versions/A/AGL
0x10215a000 - 0x102185ff7 +org.qt-project.QtPrintSupport (5.8 - 5.8.0) <F2E506B8-77BA-3891-B45B-81BA70D7A1D0> /usr/local/Cellar/qt5/5.8.0_1/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport
0x103f12000 - 0x104062ff3 +libqcocoa.dylib (0) <B03DBBA6-FE23-3D3F-8967-259B7398AD11> /Users/USER/Desktop/*/hello.app/Contents/PlugIns/platforms/libqcocoa.dylib
0x1040a7000 - 0x104491ff3 +org.qt-project.QtGui (5.8 - 5.8.0) <C420B169-71D3-3AC7-815A-EF64D5817DD3> /usr/local/Cellar/qt5/5.8.0_1/lib/QtGui.framework/Versions/5/QtGui
0x104582000 - 0x104a40ff7 +org.qt-project.QtCore (5.8 - 5.8.0) <6B4B8877-A22A-3BB7-82F5-AFDAAB75069B> /usr/local/Cellar/qt5/5.8.0_1/lib/QtCore.framework/Versions/5/QtCore
0x104aef000 - 0x104f54ff3 +org.qt-project.QtWidgets (5.8 - 5.8.0) <B26F3E21-F316-3E4A-95C2-73BD87714404> /usr/local/Cellar/qt5/5.8.0_1/lib/QtWidgets.framework/Versions/5/QtWidgets
....

6.求教各位大神指点一下,我该如何做了
...全文
251 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

16,216

社区成员

发帖
与我相关
我的任务
社区描述
Qt 是一个跨平台应用程序框架。通过使用 Qt,您可以一次性开发应用程序和用户界面,然后将其部署到多个桌面和嵌入式操作系统,而无需重复编写源代码。
社区管理员
  • Qt
  • 亭台六七座
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧