简体   繁体   中英

How to include Qt libraries in release build for Mac OS?

I have a small app and I need to make it portable. When I run.app on my Mac everything works well. But when I try to run it on another computer it crashes with the following log:

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

What can I do to make it work?

The problem with deployment on Mac is addressed by Qt (as well as on Windows) with their Qt deployment Wiki for MacOS / deployment tool QTDIR/bin/ macdeployqt . Another helpful link . Mind that that is a part of Qt technology provided and may serve you as an example so that you customize it / create own.

Besides Qt it makes sense to consider Property List Files from Apple which Qt refers to.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM