Embedded frameworks not working for everybody

Moderator
Posts: 1,140
Joined: 2005.07
Post: #1
I'm making a game right now, and I embed a version of OpenAL with my code. I followed Apple's embedding frameworks document and did the following: I compiled the OpenAL framework having the installation path being "@executable_path/../Frameworks", I added the new copy files build rule to my game, and included the framework in my project. The framework is embedded in the game as expected, and it works as expected for most people so far. Unfortunately, 2 people so far have tried running it and it looks in the Frameworks folder in my home library. The funny thing is, I don't even have a Frameworks folder in my home library. I'm compiling with GCC 4.0 under Tiger, and these 2 people are using Mac OS X 10.3.9, but other people running 10.3.9 didn't have any problems. Any idea on what the problem is and how I can fix it? The discussion is here.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
You need to either build the framework with the appropriate install_name, or build your executable with -headerpad_max_install_names and fix it up afterwards with install_name_tool.

otool -L will tell you where your app is actually going to search for the libraries & framworks.

OpenAL is preinstalled on 10.4, so naturally people there will have no problems. I believe the 10.3.x'ers who it's working for are simply red herrings -- people who've already installed Creative's OpenAL, for example.
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #3
I would prefer to just build the framework with the proper install_name. Now, how do I do that? Rasp (I'm using XCode, BTW, and I'm not too familiar with the command line developer tools)

I need to go to my parent's house for today and tomorrow, so I'll be able to test it on their iMac G5 with 10.3.9 to see if it crashes on their computer, since OpenAL isn't installed.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
Add -install_name @executable_path/../Frameworks to the other linker flags for OpenAL.

Make sure then that you link to your own OpenAL framework, not the system's.
Quote this message in a reply
Member
Posts: 277
Joined: 2004.10
Post: #5
OSC Wrote:OpenAL is preinstalled on 10.4, so naturally people there will have no problems. I believe the 10.3.x'ers who it's working for are simply red herrings -- people who've already installed Creative's OpenAL, for example.

My 10.3.9 is brand new. Do I need to install OpenAL for some reason?
I really don't want to have to put alot of developer stuff on that computer because it's not mine and it doesn't have nearly as much space as this one.

Global warming is caused by hobos and mooses
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #6
BinarySpike Wrote:My 10.3.9 is brand new. Do I need to install OpenAL for some reason?
I really don't want to have to put alot of developer stuff on that computer because it's not mine and it doesn't have nearly as much space as this one.
No, it's just that I didn't know to put the install_name in for the framework, so it only worked on people's computers where they installed OpenAL beforehand.

Thanks, OSC. I'll try it out once I get back on campus tomorrow.
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #7
OneSadCookie Wrote:Add -install_name @executable_path/../Frameworks to the other linker flags for OpenAL.

Make sure then that you link to your own OpenAL framework, not the system's.
Well, I tried that, and it still didn't work... Any other suggestions with what to do with the framework and/or can you tell me how to do the thing you told me to do with the final application?

Edit: Well, I figured out how to use otool and install_name_tool, but any suggestions on how to change the framework so it can actually work so I don't have to do the same thing all the time? Until then, I'll just use a shell script.
Quote this message in a reply
Oldtimer
Posts: 832
Joined: 2002.09
Post: #8
Check out your Copy Files build phase - the path box should be empty - not contain the framework. This bit me pretty hard today.
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #9
Alas, I didn't include the framework.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  TinyXML embedded zlib markhula 2 4,114 Oct 5, 2010 09:12 AM
Last Post: OneSadCookie
  System vs developer frameworks? OSX m3the01 1 1,940 Jun 19, 2007 04:16 PM
Last Post: OneSadCookie