I have build a App based on OS X FUSE (ie I have my own file system based on OS X FUSE). When OSXFUSE is installed I can of course include the OSXFUSE.framework from /Library/Frameworks. However when I distribute the App I cannot expect the user to already have it installed, so I tried to include the framework with the bundle as follows:
However when I run that on a system without FUSE installed I get an error:
dyld: Library not loaded: /Library/Frameworks/OSXFUSE.framework/Versions/A/OSXFUSE Referenced from: /Users/me/Library/Developer/Xcode/DerivedData/
Shouldn't the copy build phase prevent this? What am I missing here?
I finally found out that I can tell XCode explicitly to weakly link a framework by changing the required
flag to optional
.
This can be done in Project Overview > Target > Linked Frameworks and Libraries
. Next to each framework is a dropdown-menu where you can select optional
.
So my question is actually a duplicate of this How do I weak link frameworks on Xcode 4?