what's wrong with this approach re referencing another project in Xcode 4?
I'm trying to reference another Xcode4 project within Xcode4 but having troubles - what's I'm currently doing is as follows:
- In project B in XCode4 I drag in project A (from Finder) into project B
- In project B's main target, in Build Phases / Target Dependencies I add/select my project A's main target.
- I put an, #import "myProjectAClass", in one of my project B files
- when I compile I can an ERROR "myProjectAClass no such file or directory"
Any suggestions? What is the minimum number of places I need to touch/adjust in XCode4 project configuration such that I can start using clases from project B in 开发者_StackOverflow中文版project A, and it will all compile?
If I'm reading this correctly I had the same issue the other night. Except that I was dealing with two targets, one that built a static library and the other that ran an app to executes tests on the static lib. Here's what I did
- Target A builds a static lib.
- Target B runs a unit testing suite for testing target A's static lib.
In target B's settings:
- Add Target A as a dependency. This ensures that it is built first. (I think :) )
- Add the static library (libA.a) from Target A to Target B's Link Binary With Libraries list along with any frameworks the lib needs.
The second item is the important one. Adding a dependency (as I understand it) doesn't automatically include any of Target A's output to Target B's linking phase.
精彩评论