3

so first off, I want to say that this question: Bundle framework with application in XCode

and this question: OSX: changing path of .framework

were both extremely helpful getting me up to this point, but I'm still not quite there.

So, like both the Original Posters for the two previous questions, I'm trying to embed a framework inside my app bundle. Or, rather, the issue is that I'm trying to embed MULTIPLE frameworks in my app bundle, some of which depend on eachother. I believe that even though my application can successfully find the frameworks (i've changed the install directory so the frameworks know where they are), the ones that reference each other are still looking for the frameworks to be installed in the normal ~/Library/Frameworks directory.

This is the output I'm getting when trying to run my app:

Dyld Error Message:

Library not loaded: @rpath/SDL.framework/Versions/A/SDL

Referenced from: /Users/Daly/Library/Developer/Xcode/DerivedData/Coin_Checkers_2-cibyiolfgsmcicdrcfxufftxzbsk/Build/Products/Debug/Coin Checkers 2.app/Contents/MacOS/../Frameworks/SDL_image.framework/SDL_image

Reason: image not found

Binary Images: 0x7fff5fc00000 - 0x7fff5fc3be0f dyld 132.1 (???) <29DECB19-0193-2575-D838-CF743F0400B2> /usr/lib/dyld

It seems to me that It's correctly loading SDL_image, but failing when SDL_image references SDL. Is there any similar trick I can use to direct the SDL_image framework to the correct location for my embedded SDL framework?

Thanks a bunch!

Community
  • 1
  • 1
NHDaly
  • 7,390
  • 4
  • 40
  • 45

1 Answers1

2

Oh, never mind. I hadn't seen this question until it showed up in the related section on the side: Embedding frameworks in a Mac App Bundle

Apparently all I needed to do was set the runpath searchpath, and that solved all my problems. I had tried setting the Frameworks search path, but that didn't seem to help.

In fact, I redownloaded the frameworks to see if the install_name_tool steps were even necessary, and it seems they are not. they worked without it. Interesting.

Community
  • 1
  • 1
NHDaly
  • 7,390
  • 4
  • 40
  • 45
  • Just checking - I want to link 3rd party frameworks in my framework. Currently I need to give my customers my framework and every framework I link in my framework. I'm looking for a means to package it all up in my framework, so my customers do not have to link to those 3rd party frameworks. Is that what you are attempting to do in this question? If so, I'd like to get more information from you. Willing to ask a question for you at your request. – Patricia Aug 06 '14 at 19:59
  • Hi @Lucy. No, I was trying to bundle 3rd party frameworks into an _application_ bundle. But the process would be very similar, yeah! I just spent the last day trying to make it work, and I think I've figured it out. Yeah, if you want to open a new question, and comment it here, I'll gladly answer it! :) – NHDaly Aug 07 '14 at 18:21