• 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
Help needed with install path and bundling libraries
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help needed with install path and bundling libraries


  • Subject: Help needed with install path and bundling libraries
  • From: Sean Heber <email@hidden>
  • Date: Thu, 29 Sep 2005 00:50:36 -0500

I am trying to build a framework which is to built up from other dynamic libraries using the -sub_library linker option to create a kind of composite framework made up of all the smaller components. (I hope I'm understanding sub_library correctly...) I want to make this resulting framework embed-able (aka a private framework). I can't seem to figure out what the install_path should be for the libraries that the framework depends upon.

The framework itself has an install path of:
@executable_path/../Frameworks

So I tried setting the libraries' install path to this:
@executable_path/../Frameworks/MyFramework.framework/Resources

Then I set up my project so that the libraries were copied into the Resources dir of the MyFramework framework. Everything seems to be in the right spot - the libraries compile and the framework compiles.

However it doesn't work when I try to embed it. I set up my test app with a Copy Files (into Frameworks) build step and added MyFramework.framework to it. Then I set the app to link against MyFramework. When I try to build, it gives me this warning while linking:

/usr/bin/ld: warning can't open dynamic library: @executable_path/../ Frameworks/MyFramework.framework/Resources/MyLib.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2)

Then it fails due to missing symbols from the library - which makes sense since it seems to not be able to find it. Of course the files themselves are, in fact, there in the Resources dir of the MyFramework bundle which has been copied inside my test app's Frameworks dir - right where the @executable_path/../Frameworks/ MyFramework.framework/Resources/MyLib.dylib path should translate to (unless I'm misunderstanding something here)!

"otool -L" on MyFramework shows this line:
@executable_path/../Frameworks/MyFramework.framework/Resources/ MyLib.dylib (compatibility version 1.0.0, current version 1.0.0)


and "otool -L" on MyLib shows this:
@executable_path/../Frameworks/MyFramework.framework/Resources/ MyLib.dylib (compatibility version 1.0.0, current version 1.0.0)


I've played around with a lot of variations on the install path (including using just a ".") and it seems like the only paths understood by the linker are exactly "@executable_path/../Frameworks" and anything absolute (starting with a "/"). I can't seem to get any other variation of indirection based on @executable_path to work.

This all seems counter to the documentation which states (in "dyld release notes") that: "We also support the path starting with @executable_path/ which means relative to the main executable. This enables the construction of applications that could be installed anywhere."

Any suggestions?

Thanks,
Sean


_______________________________________________ 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: Help needed with install path and bundling libraries
      • From: Dave McCaldon <email@hidden>
    • Re: Help needed with install path and bundling libraries
      • From: j o a r <email@hidden>
  • Prev by Date: Re: Finder won't open Xcode projects
  • Next by Date: Re: just C++ in xcode
  • Previous by thread: Re: Finder won't open Xcode projects
  • Next by thread: Re: Help needed with install path and bundling libraries
  • Index(es):
    • Date
    • Thread