• Advertisement
Sign in to follow this  

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

This topic is 2238 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement