【问题标题】:How to include Qt libraries in release build for Mac OS?如何在 Mac OS 的发布版本中包含 Qt 库?
【发布时间】:2019-09-28 20:13:00
【问题描述】:

我有一个小应用程序,我需要使其可移植。当我在 Mac 上运行 .app 时,一切正常。但是当我尝试在另一台计算机上运行它时,它会崩溃并显示以下日志:

Process: LW1 [1070]
Path: /private/var/folders/*/LW1.app/Contents/MacOS/LW1
Identifier: com.ikramanop.LW1
Version: 0
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: LW1 [1070]
User ID: 501

Date/Time: 2019-09-28 12:23:50.558 +0300
OS Version: Mac OS X 10.14.6 (18G103)
Report Version: 12
Anonymous UUID: E6229D6B-2070-18C1-283F-BDB8F5076FA3

Time Awake Since Boot: 3100 seconds

System Integrity Protection: enabled

Notes: Translocated Process

Crashed Thread: 0

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Termination Reason: DYLD, [0x1] Library missing

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
Library not loaded: @rpath/QtCharts.framework/Versions/5/QtCharts
Referenced from: /private/var/folders/*/LW1.app/Contents/MacOS/LW1
Reason: image not found

Binary Images:
0x102829000 - 0x102833fff +com.ikramanop.LW1 (0) <854CDA56-1BD5-3C26-9CC8-CB35165CF5C5> /var/folders/*/LW1.app/Contents/MacOS/LW1
0x1126cb000 - 0x11273570f dyld (655.1.1) <DFC3C4AF-6F97-3B34-B18D-7DCB23F2A83A> /usr/lib/dyld

我该怎么做才能让它发挥作用?

【问题讨论】:

    标签: c++ macos qt linkage


    【解决方案1】:

    Qt(以及 Windows)使用他们的Qt deployment Wiki for MacOS/部署工具 QTDIR/bin/ma​​cdeployqt 解决了 Mac 上的部署问题。另一个有用的link。请注意,这是提供的 Qt 技术的一部分,可以作为示例,以便您自定义/创建自己的。

    除了 Qt 之外,考虑 Qt 所指的来自 Apple 的 Property List Files 是有意义的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-06-07
      • 2016-06-13
      • 2011-12-16
      • 2019-07-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多