Hedge Hedge - 1 month ago 18
C++ Question

dyld: Library not loaded (image not found) but it's there

I got this error when trying to launch my Qt-application (which was deployed with macdeployqt) on another Mac.

dyld: Library not loaded: kqoauth.framework/Versions/0/kqoauth
Referenced from: /MyProject.app/Contents/MacOS/MyProject
Reason: image not found
Trace/BPT trap


I checked the .app-bundle and copied the kqoauth.framework to a few different locations (Frameworks-folder, next to the executable file, Resources-folder) but the error remained.
This is my project-tree:

enter image description here

I also tried otool -L on it and everything seems to be fine. (the entry for kqoauth.framework looked the same as those for the qt-libraries)

Answer

Check that otool -L was showing relative paths for both Qt and for kqoauth, my guess is they are probably all starting at root / and you didn't see the qt loading failing, because they're installed on your system.

Regardless, I suggest following this tutorial to correctly inform the binary where all the dylibs are: Qt Deploying on Mac OS X. Here's the man for install_name_tool, which is used in that tutorial.

Comments