Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode4 Workspace with Static library project & application project

I'm working on a project where I'm going to eventually have a library of code that will be used by multiple applications. In reading though the documentation it sounded like creating an XCode4 workspace and 2 projects (1 library, and 1 application) was the way to go.

I did this and everything appeared to be working just great. However, today I did a bunch of work on my library project and when I run my application to test my library changes it appears to always be including an older compiled version. I'm at a loss, I added my library as a build target in my applications scheme and XCode tells me it's compiling the library, but its always linking to an old version.

Any help is greatly appreciated. Am I missing something in how I set my workspace up? Is there a build step that will force linking to my newly compiled .a? I've even tried removing the dependency, cleaning, re-adding the dependency and building my app and I still get the same results.

like image 653
Rob Booth Avatar asked Mar 11 '26 22:03

Rob Booth


1 Answers

I ran into same problem and my solution was to add

rm -f BUILT_PRODUCTS_DIR/$EXECUTABLE_PATH

to the build -> pre-actions section (edit scheme, expand build and add pre-action). Under Provide build settings from make sure to select your target project. This will ensure correct env vars are configured when your script runs. I'm using XCode 4.5.1.

like image 146
Robert Zeljko Avatar answered Mar 14 '26 10:03

Robert Zeljko