Linker Errors: Apple Mach-O Linker Error "_CFHTTPMessageAppendBytes", referenced from...

If you are experiencing linker errors when linking with the Reveal framework. In particular unknown symbols such as _CGColorCreate, _CGAffineTransformIdentity, _CFHTTPMessageAppendBytes, and _deflate, your project probably needs to be linking against additional frameworks.

By default Xcode's iOS project templates link an app against the following frameworks: UIKit, Foundation, & CoreGraphics.

While it is possible to remove both the Foundation and CoreGraphics frameworks from an empty iOS Xcode project and have it still build and link it is not recommended that you do so.

While we do not call it out specifically at the moment in the Reveal Integration Guide, Reveal does depend on QuartzCore, CoreGraphics, CFNetwork, and libz to function so you may receive link errors if these frameworks not included in your project and linked with your application target (particularly if you're still using Xcode 6.4).

Our integration guide instructs you to link with libz by adding -lz to the Other Linker Flags build setting and you can either add -framework CFNetwork -framework CoreGraphics in the same place or add these frameworks to the Link Binary with Libraries section of your target's Build Phases.

At present the frameworks (and shared libraries) that Reveal needs to link are as follows:

  • UIKit
  • Foundation
  • CFNetwork
  • CoreGraphics
  • QuartzCore
  • libz

While linking to additional/unnecessary frameworks has an small effect on your iOS application's startup time, the frameworks listed above are pretty much guaranteed to be included in an app even if not specifically linked to by your project and as such should have negligible effect.