将库添加到IOS应用程序会导致可怕的构建失败

时间:2013-08-23 11:19:36

标签: ios linker-errors apptentive

我正在尝试将Apptentive添加到IOS应用中。已经使用了很多外部库,例如Admob和Google分析。

我跟着this guide跟着这封信,但我不能让它融合。看下面令人讨厌的失败信息:

Undefined symbols for architecture armv7:
  "_kCTUnderlineStyleAttributeName", referenced from:
      -[ATTTTAttributedLabel commonInit] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTFontCopyName", referenced from:
      ___NSAttributedStringByScalingFontSize_block_invoke in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTFontGetSize", referenced from:
      ___NSAttributedStringByScalingFontSize_block_invoke in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_kCTForegroundColorFromContextAttributeName", referenced from:
      _NSAttributedStringBySettingColorFromContext in libApptentiveConnect.a(TTTAttributedLabel.o)
      ___NSAttributedStringBySettingColorFromContext_block_invoke in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTFramesetterSuggestFrameSizeWithConstraints", referenced from:
      -[ATTTTAttributedLabel textRectForBounds:limitedToNumberOfLines:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel sizeThatFits:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTFontGetUnderlineThickness", referenced from:
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTLineGetGlyphRuns", referenced from:
      -[ATTTTAttributedLabel drawBackground:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTFrameGetLineOrigins", referenced from:
      -[ATTTTAttributedLabel characterIndexAtPoint:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawBackground:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTRunGetTypographicBounds", referenced from:
      -[ATTTTAttributedLabel drawBackground:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTRunGetStringRange", referenced from:
      -[ATTTTAttributedLabel drawBackground:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTLineGetOffsetForStringIndex", referenced from:
      -[ATTTTAttributedLabel drawBackground:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTLineCreateTruncatedLine", referenced from:
      -[ATTTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTLineDraw", referenced from:
      -[ATTTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_kCAGravityResizeAspect", referenced from:
      -[ATFileMessageCell layoutSubviews] in libApptentiveConnect.a(ATFileMessageCell.o)
      -[ATFileMessageCell setCurrentImage:] in libApptentiveConnect.a(ATFileMessageCell.o)
  "_CTFramesetterCreateFrame", referenced from:
      -[ATTTTAttributedLabel characterIndexAtPoint:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel sizeThatFits:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_kCTFontAttributeName", referenced from:
      ___65-[ATMessageCenterViewController tableView:cellForRowAtIndexPath:]_block_invoke in libApptentiveConnect.a(ATMessageCenterViewController.o)
      ___65-[ATMessageCenterViewController tableView:cellForRowAtIndexPath:]_block_invoke666 in libApptentiveConnect.a(ATMessageCenterViewController.o)
      ___65-[ATMessageCenterViewController tableView:cellForRowAtIndexPath:]_block_invoke685 in libApptentiveConnect.a(ATMessageCenterViewController.o)
      _NSAttributedStringAttributesFromLabel in libApptentiveConnect.a(TTTAttributedLabel.o)
      _NSAttributedStringByScalingFontSize in libApptentiveConnect.a(TTTAttributedLabel.o)
      ___NSAttributedStringByScalingFontSize_block_invoke in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTFrameGetLines", referenced from:
      -[ATTTTAttributedLabel characterIndexAtPoint:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawBackground:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel sizeThatFits:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_kCTFontPostScriptNameKey", referenced from:
      ___NSAttributedStringByScalingFontSize_block_invoke in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTFramesetterCreateWithAttributedString", referenced from:
      -[ATTTTAttributedLabel framesetter] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawTextInRect:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTLineGetTypographicBounds", referenced from:
      -[ATTTTAttributedLabel characterIndexAtPoint:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawBackground:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTLineGetStringIndexForPosition", referenced from:
      -[ATTTTAttributedLabel characterIndexAtPoint:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTLineGetStringRange", referenced from:
      -[ATTTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel sizeThatFits:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_kCTSuperscriptAttributeName", referenced from:
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_kCTParagraphStyleAttributeName", referenced from:
      -[ATTTTAttributedLabel commonInit] in libApptentiveConnect.a(TTTAttributedLabel.o)
      _NSAttributedStringAttributesFromLabel in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_kCTForegroundColorAttributeName", referenced from:
      ___65-[ATMessageCenterViewController tableView:cellForRowAtIndexPath:]_block_invoke666 in libApptentiveConnect.a(ATMessageCenterViewController.o)
      -[ATTTTAttributedLabel commonInit] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      _NSAttributedStringAttributesFromLabel in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawTextInRect:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      ___NSAttributedStringBySettingColorFromContext_block_invoke in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTLineGetPenOffsetForFlush", referenced from:
      -[ATTTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTRunGetAttributes", referenced from:
      -[ATTTTAttributedLabel drawBackground:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTParagraphStyleCreate", referenced from:
      -[ATTTTAttributedLabel commonInit] in libApptentiveConnect.a(TTTAttributedLabel.o)
      _NSAttributedStringAttributesFromLabel in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTFontCreateWithName", referenced from:
      ___65-[ATMessageCenterViewController tableView:cellForRowAtIndexPath:]_block_invoke in libApptentiveConnect.a(ATMessageCenterViewController.o)
      ___65-[ATMessageCenterViewController tableView:cellForRowAtIndexPath:]_block_invoke666 in libApptentiveConnect.a(ATMessageCenterViewController.o)
      ___65-[ATMessageCenterViewController tableView:cellForRowAtIndexPath:]_block_invoke685 in libApptentiveConnect.a(ATMessageCenterViewController.o)
      -[ATTTTAttributedLabel drawStrike:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
      _NSAttributedStringAttributesFromLabel in libApptentiveConnect.a(TTTAttributedLabel.o)
      ___NSAttributedStringByScalingFontSize_block_invoke in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_CTLineCreateWithAttributedString", referenced from:
      -[ATTTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in libApptentiveConnect.a(TTTAttributedLabel.o)
  "_OBJC_CLASS_$_CTTelephonyNetworkInfo", referenced from:
      objc-class-ref in libApptentiveConnect.a(ATLegacyRecord.o)
      objc-class-ref in libApptentiveConnect.a(ATDeviceInfo.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

出了什么问题,我该如何解决?现在已经2天了,我疯了。

eta:如果我在一个更轻量级的项目中遵循完全相同的步骤,它就构建得很好,所以我猜测存在某种冲突。我只是不知道如何解决它。

1 个答案:

答案 0 :(得分:12)

您尚未向项目添加一些框架。 (据推测,CoreTextCoreTelephony

有关如何执行此操作,请参阅How to “add existing frameworks” in Xcode 4?

Apptentive guide的引用:

  

要使用ApptentiveConnect,您的项目必须链接到   以下框架:

     

CoreData
CoreText
CoreGraphics
CoreTelephony
基础
QuartzCore
  StoreKit
SystemConfiguration
UIKit