Dyld: library not loaded (image not found), but it is there

I got this error when trying to run my Qt application (which was deployed using 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 package and copied kqoauth.framework to several different places (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 and everything seems to be fine. (the entry for kqoauth.framework looked the same as for qt libraries)

+4
source share
2 answers

Make sure otool -L shows relative paths for both Qt and kqoauth. I suppose that they probably start with root / , and you have not noticed that qt has failed to load because they are installed on your system.

Regardless, I suggest following this guide to properly inform the binary where all dylib are: Qt Deployment on Mac OS X. Here is the person for install_name_tool that is used in this tutorial.

+3
source

I solved this problem by changing the following settings

Go to Your_Target project settings-> General> Embedded binaries-> Click the + button and add your library here

+1
source

All Articles