Original Post
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!
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!