• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Embedding a Framework
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Embedding a Framework
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Set watchpoint on instance variable
  • Next by Date: Re: Embedding a Framework
  • Previous by thread: Set watchpoint on instance variable
  • Next by thread: Re: Embedding a Framework
  • Index(es):
    • Date
    • Thread