OS X 10.11.4 Dynamic Library Dependency Problem
Hello! When I try to launch my qt application on other mac there appears problem with Dyld Error. While googling possible solutions unfortunately I couldn't figure out how to fix this. Please give me some hints with it. Here's error log. Thanks in advance.
Process: iv_macos 
Code Type: X86-64 (Native)
Parent Process: ??? 
Responsible: iv_macos 
User ID: 501
Date/Time: 2016-07-09 01:10:43.909 +0300
OS Version: Mac OS X 10.11.4 (15E65)
Report Version: 11
Time Awake Since Boot: 1100000 seconds
Time Since Wake: 7400 seconds
System Integrity Protection: enabled
Crashed Thread: 0
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
dyld: launch, loading dependent libraries
Dyld Error Message:
Library not loaded: @rpath/QtMultimediaWidgets.framework/Versions/5/QtMultimediaWidgets
Referenced from: /Users/USER/Downloads/iv_macos.app/Contents/MacOS/iv_macos
Reason: image not found
0x7fff64629000 - 0x7fff646600d7 dyld (360.21) <D9B236BC-4AC1-325F-B3EF-3F06DBDA7119> /usr/lib/dyld
Model: MacBookPro11,2, BootROM MBP112.0138.B17, 4 processors, Intel Core i7, 2.2 GHz, 16 GB, SMC 2.18f15
Graphics: Intel Iris Pro, Intel Iris Pro, Built-In
Memory Module: BANK 0/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54343147533641465238412D50422020
Memory Module: BANK 1/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54343147533641465238412D50422020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x134), Broadcom BCM43xx 1.0 (22.214.171.124.1a6)
Bluetooth: Version 4.4.4f4 17685, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
Serial ATA Device: APPLE SSD SM0256F, 251 GB
USB Device: USB 3.0 Bus
USB Device: Apple Internal Keyboard / Trackpad
USB Device: BRCM20702 Hub
USB Device: Bluetooth USB Host Controller
Thunderbolt Bus: MacBook Pro, Apple Inc., 17.1
Hi and welcome to devnet,
Did you run macdeployqt on your application before copying on that other computer ?
Since you seem to be missing the QtMultimediaWidgets framework, I'm wondering if you missed an error message when running macdeployqt.
Did you saw anything unusual ?
The output of macdeployqt run the first time would be more helpful. Delete the app bundle, recreate it and then run macdeployqt on it with the verbose mode on so you'll have more details about what is going on.
Why are you calling it with sudo ?
You forgot to make it verbose
@SGaist I try without sudo. What means verbose?
Verbose means "output more log information". Use the
-verbose=3option and see if there's anything in the output talking about QtMultimedia
Is it me or the QtMultimediaWidgets module wasn't listed ?
At first sight, it looks correct. Can you run
otool -l your_app.app/Contents/MacOS/exec_nameand look what you get for the rpath entries ?
@Sasha-Kolesnikov Build after deploy it is a bad idea. This is solution
Do you mean that you re-built your application after calling madecployqt ?
Indeed, that's not a good idea. Your application executable will be replaced nullifying the job done by
macdeployqt. You'll have to call it again before re-releasing again your application.
I've had similar problems with dynamic libraries in 10.11.4. The problems go away if I turn off System Integrity Protection.
These don't show up for every executable. It depends on where the executable is installed. My executable is a Safari extension, which has to be installed in /Library/Internet Plug-ins. Apparently, that (or running in Safari) makes the executable "protected."
I ran into two kinds of problems:
- The executable used @rpath to load components of the Framework libraries (inserted into the package by macdeployqt). This doesn't appear to work with System Integrity Protection. @loader_path does work, as do absolute paths. (You can change the paths using install_name_tool).
- Qt loads plugins using dlopen. This doesn't appear to work at all with System Integrity Protection. As a result, the code fails in QtGuiApplication::createPlatformIntegration, which is where it tries to load the platform plugin.
I haven't found a workaround for the second problem. As a result it appears that Qt won't work for "protected" executables under OS X El Capitan.