Skip to main content
GameDev.net gamedev.net
🔒 Locked

(New to XCode) Program runs find in XCode, fails at terminal window

Started by BackFlipp Mar 8, 2012 at 8:01 PM 0 replies 900+ views
Original Post
BackFlipp
BackFlipp
Heya!

I'm very new to XCode's IDE so bear with me here. I've got two xcodeproj projects: A and B. A builds a framework, and B links to it via B->External Frameworks And Libraries->A.framework. Both are set to build to the $(PROJECT)/builds/Development directory, and do so successfully.

When I run B from within XCode after building it, it starts up successfully and runs. However, when I open a terminal and navigate to $(PROJECT)/builds/Development and run ./B, it fails with the error "dyld: Library not loaded: @executable_path/.../Frameworks/A.framework/Versions/A/A". Now, as far as I can tell, the only thing that can possibly change between the two settings (XCode vs Terminal) is some path environment variable that is set in XCode that isn't present in the Terminal.

So, a few questions:
1. Why would it successfully find the A framework when I run it from XCode, when there is no "Frameworks" folder anywhere inside side the project?
2. I have the "Framework Search Paths" set up for $(PROJECT)/builds/Development, but it doesn't seem to do anything. Is that only for building?
3. Does setting A's "Dynamic Library Install Name" to something like "@executable_path/.../Frameworks" require that any executable that uses it be located relative to it? It seems a little backwards to require that the app be located relative to the framework. On Linux, you'd install the library to /usr/local/lib and the executable anywhere you'd want, ya?

Thanks!
Aressera
Aressera
Build it in release mode and it should work fine. I doubt that the debug executables work without some linking magic performed by the IDE.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.