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

Re: Help needed with install path and bundling libraries


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

On Sep 29, 2005, at 9:31 AM, Dave McCaldon wrote:

The problem is that Xcode doesn't seem to understand the "specialness" of the Libraries directory. So when I build the framework, I need to do this:

* Copy libA, libB and libC into $OUTPUTDIR/Foobar.framework/ Libraries
* Run install_name_tool to:
- set the name for each library to @executable_path/../ Frameworks/Foobar.framework/Libraries
- Since libB uses libC, I also need to change the name of libC in libA as above so it can find it
* Compile the framework itself
* Link the main framework with:
-l for each of libA, libB and libC (yes, you need to do libC because libA uses it)
-L set to $OUTPUTDIR/Foobar.framework/Libraries (so the linker can find the modified


This works for an embedded framework and will work in all Mac OS X versions (well, I've never tried Jaguar!).

Are there any other build settings that might affect this that I've perhaps got set wrong? I tried the above steps and it still does not work for me. The framework and library built and linked fine as usual. I changed the Other Linker Flags on MyFramework to use the following: -sub_library libmyLib -lmyLib


(I also changed the name of MyLib.dylib to libmyLib.dylib since there seemed to be an assumption of "lib" in the filename.)

The install path of libmyLib.dylib is:
@executable_path/../Frameworks/MyFramework.framework/Libraries

I added the appropriate copy files build step to make the right structure (as you indicated previously).

After trying to build and link my test app that embeds MyFramework, I get the following warning:

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

And of course it then fails with missing symbols again.

otool -L on the framework shows this line:
@executable_path/../Frameworks/MyFramework.framework/Libraries/ libmyLib.dylib (compatibility version 1.0.0, current version 1.0.0)


otool -D on libmyLib.dylib shows:
libmyLib.dylib:
@executable_path/../Frameworks/MyFramework.framework/Libraries/ libmyLib.dylib


If you've had success getting this to work, there must be something I'm not doing correctly. It's probably something silly. I really need to get this working...

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


References: 
 >Help needed with install path and bundling libraries (From: Sean Heber <email@hidden>)
 >Re: Help needed with install path and bundling libraries (From: Dave McCaldon <email@hidden>)

  • Prev by Date: Re: SIGBUS when I set a breakpoint
  • Next by Date: Re: Strip
  • Previous by thread: Re: Help needed with install path and bundling libraries
  • Next by thread: Re: Help needed with install path and bundling libraries
  • Index(es):
    • Date
    • Thread