I have a project in Xcode 4 (the latest non-beta version) that builds fine when built in Xcode itself. Specifically, the Ld command correctly uses the derived data directory (wh
I ran in to the same issue yesterday and was able to work it out. In an effort to narrow down what worked for James, I'll point to what I had to do. I had to add a workspace and switch to running xcodebuild with workspace/scheme instead of project/target.
Using workspace/scheme forced xcodebuild to use the DerivedData folder instead of the build output folder under the main project. This allowed the linker to find the associated static library.
This blog post was hugely helpful:
http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/