Search code examples
iosxcode4zxing

iOS; using ZXing 2.0, trouble linking to libZXingWidget.a with Xcode 4.2


I'm trying to cleanly link ZXing into my iOS project. This is what I did...

  1. Create an empty workspace.
  2. In the workspace, file > workspace settings > derived data location: Workspace-relative
  3. Added my own project into it.
  4. Added the ZXingWidget project. This in itself builds cleanly.
  5. Per the README, added header search paths, and libraries such as AVFoundation.

So now I go to Build Phases > Link Binary with Libraries > + > Workspace > libZXingWidget.a. It lets me do this, but the resulting .a appears red. Do you know what would cause this?

I can however 'add other' ... DerivedData ... point to libZXingWidget.a. by hand. This feels wrong and may not work in all schemes. Also when I try setting ZXingWidget as a target dependency, nothing shows up. Any idea what could be wrong?


Solution

  • Adding it via the Build Phases is right. It'll appear red until it gets built as a dependent project, which it will do as soon as you do a build on the top level project.