Question

I'm following a nextpeer guidelines for integrating nextpeer in cocos2d-x with c++, i have copied the required frameworks and classes in project, then added the required frameworks for nextpeer, also add the linker flags but there are Apple Mach-O linker errors, here is a log:

 Undefined symbols for architecture i386:
 "_CTFontCopyFullName", referenced from:
    -[NSMutableAttributedString(NP_OHCommodityStyleModifiers) npSetTextBold:range:] in       Nextpeer(NP_NSAttributedString+Attributes.o)
 "_CTFontCreateCopyWithAttributes", referenced from:
  ___NP_NSAttributedStringByScalingFontSize_block_invoke in Nextpeer(NP_TTTAttributedLabel.o)
 "_CTFontCreateCopyWithSymbolicTraits", referenced from:
  -[NSMutableAttributedString(NP_OHCommodityStyleModifiers) npSetTextBold:range:] in Nextpeer(NP_NSAttributedString+Attributes.o)
 "_CTFontCreateUIFontForLanguage", referenced from:
  -[NSMutableAttributedString(NP_OHCommodityStyleModifiers) npSetTextBold:range:] in Nextpeer(NP_NSAttributedString+Attributes.o)
 "_CTFontCreateWithFontDescriptor", referenced from:
  -[NSMutableAttributedString(NP_OHCommodityStyleModifiers) npSetFontFamily:size:bold:italic:range:] in Nextpeer(NP_NSAttributedString+Attributes.o)
"_CTFontCreateWithName", referenced from:
  _NP_NSAttributedStringAttributesFromLabel in Nextpeer(NP_TTTAttributedLabel.o)
  -[NSMutableAttributedString(NP_OHCommodityStyleModifiers) npSetFontName:size:range:] in Nextpeer(NP_NSAttributedString+Attributes.o)
"_CTFontDescriptorCreateWithAttributes", referenced from:
  -[NSMutableAttributedString(NP_OHCommodityStyleModifiers) npSetFontFamily:size:bold:italic:range:] in Nextpeer(NP_NSAttributedString+Attributes.o)
"_CTFontGetSize", referenced from:
  ___39+[NP_OHASBasicMarkupParser tagMappings]_block_invoke_3 in Nextpeer(NP_OHASBasicMarkupParser.o)
  ___NP_NSAttributedStringByScalingFontSize_block_invoke in Nextpeer(NP_TTTAttributedLabel.o)
 "_CTFontGetSymbolicTraits", referenced from:
  -[NSAttributedString(NP_OHCommodityConstructors) npTextIsBoldAtIndex:effectiveRange:] in Nextpeer(NP_NSAttributedString+Attributes.o)
 "_CTFrameGetLineOrigins", referenced from:
  -[NP_TTTAttributedLabel characterIndexAtPoint:] in Nextpeer(NP_TTTAttributedLabel.o)
  -[NP_TTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in Nextpeer(NP_TTTAttributedLabel.o)
 "_CTFrameGetLines", referenced from:
  -[NP_TTTAttributedLabel characterIndexAtPoint:] in Nextpeer(NP_TTTAttributedLabel.o)
  -[NP_TTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in Nextpeer(NP_TTTAttributedLabel.o)
  -[NP_TTTAttributedLabel sizeThatFits:] in Nextpeer(NP_TTTAttributedLabel.o)
 "_CTFramesetterCreateFrame", referenced from:
  -[NP_TTTAttributedLabel characterIndexAtPoint:] in Nextpeer(NP_TTTAttributedLabel.o)
  -[NP_TTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in Nextpeer(NP_TTTAttributedLabel.o)
  -[NP_TTTAttributedLabel sizeThatFits:] in Nextpeer(NP_TTTAttributedLabel.o)
 "_CTFramesetterCreateWithAttributedString", referenced from:
  -[NP_TTTAttributedLabel framesetter] in Nextpeer(NP_TTTAttributedLabel.o)
  -[NP_TTTAttributedLabel drawTextInRect:] in Nextpeer(NP_TTTAttributedLabel.o)
  -[NSAttributedString(NP_OHCommodityConstructors) npSizeConstrainedToSize:fitRange:] in Nextpeer(NP_NSAttributedString+Attributes.o)
 "_CTFramesetterSuggestFrameSizeWithConstraints", referenced from:
  -[NP_TTTAttributedLabel textRectForBounds:limitedToNumberOfLines:] in Nextpeer(NP_TTTAttributedLabel.o)
  -[NP_TTTAttributedLabel sizeThatFits:] in Nextpeer(NP_TTTAttributedLabel.o)
  -[NSAttributedString(NP_OHCommodityConstructors) npSizeConstrainedToSize:fitRange:] in Nextpeer(NP_NSAttributedString+Attributes.o)
 "_CTLineCreateTruncatedLine", referenced from:
  -[NP_TTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in Nextpeer(NP_TTTAttributedLabel.o)
 "_CTLineCreateWithAttributedString", referenced from:
  -[NP_TTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in Nextpeer(NP_TTTAttributedLabel.o)
 "_CTLineDraw", referenced from:
  -[NP_TTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in Nextpeer(NP_TTTAttributedLabel.o)
 "_CTLineGetStringIndexForPosition", referenced from:
  -[NP_TTTAttributedLabel characterIndexAtPoint:] in Nextpeer(NP_TTTAttributedLabel.o)
 "_CTLineGetStringRange", referenced from:
  -[NP_TTTAttributedLabel drawFramesetter:attributedString:textRange:inRect:context:] in Nextpeer(NP_TTTAttributedLabel.o)
  -[NP_TTTAttributedLabel sizeThatFits:] in Nextpeer(NP_TTTAttributedLabel.o)
 "_CTLineGetTypographicBounds", referenced from:
  -[NP_TTTAttributedLabel characterIndexAtPoint:] in Nextpeer(NP_TTTAttributedLabel.o)
 "_CTParagraphStyleCreate", referenced from:
  -[NP_TTTAttributedLabel commonInit] in Nextpeer(NP_TTTAttributedLabel.o)
  _NP_NSAttributedStringAttributesFromLabel in Nextpeer(NP_TTTAttributedLabel.o)
  -[NSMutableAttributedString(NP_OHCommodityStyleModifiers) npSetTextAlignment:lineBreakMode:range:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  "_CTParagraphStyleGetValueForSpecifier", referenced from:
  -[NSAttributedString(NP_OHCommodityConstructors) npTextAlignmentAtIndex:effectiveRange:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  -[NSAttributedString(NP_OHCommodityConstructors) npLineBreakModeAtIndex:effectiveRange:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  "_kCTFontAttributeName", referenced from:
  _NP_NSAttributedStringAttributesFromLabel in Nextpeer(NP_TTTAttributedLabel.o)
  -[NP_TTTAttributedLabel drawTextInRect:] in Nextpeer(NP_TTTAttributedLabel.o)
  ___NP_NSAttributedStringByScalingFontSize_block_invoke in Nextpeer(NP_TTTAttributedLabel.o)
  -[NSAttributedString(NP_OHCommodityConstructors) npFontAtIndex:effectiveRange:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  -[NSMutableAttributedString(NP_OHCommodityStyleModifiers) npSetFontName:size:range:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  -[NSMutableAttributedString(NP_OHCommodityStyleModifiers) npSetFontFamily:size:bold:italic:range:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  -[NSMutableAttributedString(NP_OHCommodityStyleModifiers) npSetTextBold:range:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  ...
  _NP_NSAttributedStringAttributesFromLabel in Nextpeer(NP_TTTAttributedLabel.o)
  -[NP_TTTAttributedLabel drawTextInRect:] in Nextpeer(NP_TTTAttributedLabel.o)
  ___NP_NSAttributedStringByScalingFontSize_block_invoke in Nextpeer(NP_TTTAttributedLabel.o)
  -[NSAttributedString(NP_OHCommodityConstructors) npFontAtIndex:effectiveRange:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  -[NSMutableAttributedString(NP_OHCommodityStyleModifiers) npSetFontName:size:range:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  -[NSMutableAttributedString(NP_OHCommodityStyleModifiers) npSetFontFamily:size:bold:italic:range:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  -[NSMutableAttributedString(NP_OHCommodityStyleModifiers) npSetTextBold:range:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  ...
  "_kCTFontFamilyNameAttribute", referenced from:
  -[NSMutableAttributedString(NP_OHCommodityStyleModifiers) npSetFontFamily:size:bold:italic:range:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  "_kCTFontSymbolicTrait", referenced from:
  -[NSMutableAttributedString(NP_OHCommodityStyleModifiers) npSetFontFamily:size:bold:italic:range:] in Nextpeer(NP_NSAttributedString+Attributes.o)
 "_kCTFontTraitsAttribute", referenced from:
  -[NSMutableAttributedString(NP_OHCommodityStyleModifiers) npSetFontFamily:size:bold:italic:range:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  "_kCTForegroundColorAttributeName", referenced from:
  -[NP_TTTAttributedLabel commonInit] in Nextpeer(NP_TTTAttributedLabel.o)
  _NP_NSAttributedStringAttributesFromLabel in Nextpeer(NP_TTTAttributedLabel.o)
  -[NP_TTTAttributedLabel drawTextInRect:] in Nextpeer(NP_TTTAttributedLabel.o)
  ___NP_NSAttributedStringBySettingColorFromContext_block_invoke in Nextpeer(NP_TTTAttributedLabel.o)
  -[NSAttributedString(NP_OHCommodityConstructors) npTextColorAtIndex:effectiveRange:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  -[NSMutableAttributedString(NP_OHCommodityStyleModifiers) npSetTextColor:range:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  -[NP_TTTAttributedLabel commonInit] in Nextpeer(NP_TTTAttributedLabel.o)
  _NP_NSAttributedStringAttributesFromLabel in Nextpeer(NP_TTTAttributedLabel.o)
  -[NP_TTTAttributedLabel drawTextInRect:] in Nextpeer(NP_TTTAttributedLabel.o)
  ___NP_NSAttributedStringBySettingColorFromContext_block_invoke in Nextpeer(NP_TTTAttributedLabel.o)
  -[NSAttributedString(NP_OHCommodityConstructors) npTextColorAtIndex:effectiveRange:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  -[NSMutableAttributedString(NP_OHCommodityStyleModifiers) npSetTextColor:range:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  "_kCTForegroundColorFromContextAttributeName", referenced from:
  -[NP_TTTAttributedLabel renderedAttributedText] in Nextpeer(NP_TTTAttributedLabel.o)
  ___NP_NSAttributedStringBySettingColorFromContext_block_invoke in Nextpeer(NP_TTTAttributedLabel.o)
  "_kCTParagraphStyleAttributeName", referenced from:
  -[NP_TTTAttributedLabel commonInit] in Nextpeer(NP_TTTAttributedLabel.o)
  _NP_NSAttributedStringAttributesFromLabel in Nextpeer(NP_TTTAttributedLabel.o)
  -[NSAttributedString(NP_OHCommodityConstructors) npTextAlignmentAtIndex:effectiveRange:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  -[NSAttributedString(NP_OHCommodityConstructors) npLineBreakModeAtIndex:effectiveRange:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  -[NSMutableAttributedString(NP_OHCommodityStyleModifiers) npSetTextAlignment:lineBreakMode:range:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  -[NP_TTTAttributedLabel commonInit] in Nextpeer(NP_TTTAttributedLabel.o)
  _NP_NSAttributedStringAttributesFromLabel in Nextpeer(NP_TTTAttributedLabel.o)
  -[NSAttributedString(NP_OHCommodityConstructors) npTextAlignmentAtIndex:effectiveRange:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  -[NSAttributedString(NP_OHCommodityConstructors) npLineBreakModeAtIndex:effectiveRange:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  -[NSMutableAttributedString(NP_OHCommodityStyleModifiers) npSetTextAlignment:lineBreakMode:range:] in Nextpeer(NP_NSAttributedString+Attributes.o)
   "_kCTUnderlineStyleAttributeName", referenced from:
  -[NP_TTTAttributedLabel commonInit] in Nextpeer(NP_TTTAttributedLabel.o)
  -[NSAttributedString(NP_OHCommodityConstructors) npTextUnderlineStyleAtIndex:effectiveRange:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  -[NSMutableAttributedString(NP_OHCommodityStyleModifiers) npSetTextUnderlineStyle:range:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  -[NP_TTTAttributedLabel commonInit] in Nextpeer(NP_TTTAttributedLabel.o)
  -[NSAttributedString(NP_OHCommodityConstructors) npTextUnderlineStyleAtIndex:effectiveRange:] in Nextpeer(NP_NSAttributedString+Attributes.o)
  -[NSMutableAttributedString(NP_OHCommodityStyleModifiers) npSetTextUnderlineStyle:range:] in Nextpeer(NP_NSAttributedString+Attributes.o)

  ld: symbol(s) not found for architecture i386
  clang: error: linker command failed with exit code 1 (use -v to see invocation)

these are the frameworks which i've added in my project:

CoreText.framework
OpenGLES.framework
Security.framework
MobileCoreServices.framework
StoreKit.framework
SystemConfiguration.framework
CFNetwork.framework
MessageUI.framework
AdSupport.framework - (**) Optional
QuartzCore.framework
UIKit.framework
CoreGraphics.framework
Foundation.framework
libz.dylib
libsqlite3.dylib

and this is the linker flag which i have added

-ObjC

How Do i Fix this? please help.

Was it helpful?

Solution

You need to link the CoreText framework into your app.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top