Pregunta

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:

  • dragged the framework from /Library/Frameworks to my project
  • created a new Copy Files build phase (with target Frameworks)
  • added the framework to that copy build phase

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?

¿Fue útil?

Solución

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.

Change link status for framework

So my question is actually a duplicate of this How do I weak link frameworks on Xcode 4?

Otros consejos

I believe that the OSXFuse framework needs a corresponding kernel module to work. This has to be installed separately so you would have to put together an installer package that first installs the kernel module and the preferences pane, and then installs your application.

Alternatively, you could notify the user that the module needs to be installed separately and provide a download link or something to that effect.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top