Question

clang --version

Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) Target: x86_64-apple-darwin13.0.0 Thread model: posix

I'm looking to compile a file linking it against a "plugin" under

/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/

Running

file /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/MemoryPlugin.bundle/Contents/MacOS/MemoryPlugin

Returns

/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/MemoryPlugin.bundle/Contents/MacOS/MemoryPlugin: Mach-O 64-bit bundle x86_64

Is there a way to link to it in a similar way to Frameworks (.framework) and library files (.a)?

Was it helpful?

Solution

As far as I can see, there is no way to link to a bundle, you need to "load" it, effectively making all its symbols available.

i.e.

[[NSBundle bundleWithPath:@"/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/MemoryPlugin.bundle"] load];

Update

OS X ABI Mach-O File Format Reference

The MH_BUNDLE file type is the type typically used by code that you load at runtime (typically called bundles or plug-ins). By convention, the file name extension for this format is .bundle.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top