Search code examples
iphoneiosxcoderestkit

Linker Error with Restkit, Restkit.framework not found


Problem

After going through install instructions for Restkit on iOS, I'm receiving a Apple Mach-o linker error:

enter image description here

My Process

I tried to follow the Restkit install instructions found here: https://github.com/RestKit/RestKit/wiki/Installing-RestKit-in-Xcode-4.x

I added Restkit as a submodule through Git first.

I added Restkit to my project, and added the necessary configurations to the Project's Target build settings enter image description here enter image description here

I then added Restkit as a Target Dependency

enter image description here

Clues to the Solution

For whatever reason, a few files in Restkit are appearing in Red.

enter image description here

This results in similar behavior when linking the Restkit Framework

enter image description here

What I've Tried

  1. I tried deleting and readding Restkit to no avail.
  2. I've tried moving it within the Xcode project but this only made matters more strange (The target no longer recognized its dependancy to Restkit).
  3. I confirmed that what I've typed in the build settings was correct.
  4. I checked SO for the solution and even checked common solutions to Linker Errors Apple Mach-O Linker Error when compiling for device I did not see any apparent solutions (I may be wrong).

That's it. I do hope this is enough to solve the problem.

Edit: An extra image confirming the header search path:

enter image description here


Solution

  • Well, the solution is silly, but I realized that Restkit does not actually need the Restkit.framework to be built on iOS. It instead needs the libRestkit.a file to be added to the 'link binary with libraries' section.

    This allows you to add <Restkit/Restkit.h> to your code with no compile errors or warnings.