Embedding a Framework
Embedding a Framework
- Subject: Embedding a Framework
- From: Roland King <email@hidden>
- Date: Thu, 24 Jul 2014 23:14:27 +0800
I’ve been working on an OSX app for a while. There’s a few moving parts, the App, which depends on a Framework I build, plus three bundles. The bundles are wireshark plugins, the Framework is an OSX version of libpcap. So the App depends on the framework and the bundles, the bundles are copied in the copy phase and end up inside the app and they work just fine, I use the bundle resource loader to find them.
I can add the Framework to an extra copy phase and get that in the app under <app path>/Frameworks/<whatever> too but checking the app binary with otool -l I find the framework is referenced thus
Load command 12 cmd LC_LOAD_DYLIB cmdsize 80 name /Library/Frameworks/pcapng.framework/Versions/A/pcapng (offset 24) time stamp 2 Thu Jan 1 07:30:02 1970 current version 1.0.0 compatibility version 1.0.0
It works in Debug mode, but I assume Xcode fiddles the loader paths to make it work, if you run the binary straight it fails to load the Framework, says it can’t find it.
That path in the binary is completely absolute right? Only a framework in /Library/Frameworks/… will work without fiddling the loader paths?
Is my only option using install_name_tool and changing the name to an @rpath or similar (which is a bit horrid) or is there a way to tell Xcode to embed the Framework in the binary with a binary-relative path when it builds and copies it so the App binary is consistent from the get-go? |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden