Apple mach-o链接器错误

时间:2015-09-30 17:01:50

标签: ios xcode swift linker

这些是我的错误。我从github下载了一个项目。我不明白这些错误

https://github.com/MosheBerman/MBCalendarKit

Ld /Users/swaroop/Library/Developer/Xcode/DerivedData/MBCalendarKit-geotokkaaaikwrdezpghqegghtxl/Build/Products/Debug-iphonesimulator/MBCalendarKitTests.xctest/MBCalendarKitTests normal x86_64
    cd /Users/swaroop/Downloads/MBCalendarKit-master
    export IPHONEOS_DEPLOYMENT_TARGET=6.1
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk -L/Users/swaroop/Library/Developer/Xcode/DerivedData/MBCalendarKit-geotokkaaaikwrdezpghqegghtxl/Build/Products/Debug-iphonesimulator -F/Users/swaroop/Library/Developer/Xcode/DerivedData/MBCalendarKit-geotokkaaaikwrdezpghqegghtxl/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/Developer/Library/Frameworks -filelist /Users/swaroop/Library/Developer/Xcode/DerivedData/MBCalendarKit-geotokkaaaikwrdezpghqegghtxl/Build/Intermediates/MBCalendarKit.build/Debug-iphonesimulator/MBCalendarKitTests.build/Objects-normal/x86_64/MBCalendarKitTests.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -framework XCTest -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.1 -Xlinker -dependency_info -Xlinker /Users/swaroop/Library/Developer/Xcode/DerivedData/MBCalendarKit-geotokkaaaikwrdezpghqegghtxl/Build/Intermediates/MBCalendarKit.build/Debug-iphonesimulator/MBCalendarKitTests.build/Objects-normal/x86_64/MBCalendarKitTests_dependency_info.dat -o /Users/swaroop/Library/Developer/Xcode/DerivedData/MBCalendarKit-geotokkaaaikwrdezpghqegghtxl/Build/Products/Debug-iphonesimulator/MBCalendarKitTests.xctest/MBCalendarKitTests

Undefined symbols for architecture x86_64:
  "_CGContextAddLineToPoint", referenced from:
      -[MBPolygonView polyImage] in MBPolygonView.o
  "_CGContextClearRect", referenced from:
      -[MBPolygonView polyImage] in MBPolygonView.o
  "_CGContextFillPath", referenced from:
      -[MBPolygonView polyImage] in MBPolygonView.o
  "_CGContextMoveToPoint", referenced from:
      -[MBPolygonView polyImage] in MBPolygonView.o
  "_CGContextRestoreGState", referenced from:
      -[MBPolygonView polyImage] in MBPolygonView.o
  "_CGContextSaveGState", referenced from:
      -[MBPolygonView polyImage] in MBPolygonView.o
  "_CGRectContainsPoint", referenced from:
      -[CKCalendarHeaderView tapHandler:] in CKCalendarHeaderView.o
      -[CKCalendarView pointInside:withEvent:] in CKCalendarView.o
  "_CGRectGetHeight", referenced from:
      -[CKCalendarCell setFrame:] in CKCalendarCell.o
      -[CKCalendarView layoutSubviewsAnimated:] in CKCalendarView.o
  "_CGRectGetMaxY", referenced from:
      -[CKCalendarView layoutSubviewsAnimated:] in CKCalendarView.o
  "_CGRectGetWidth", referenced from:
      -[CKCalendarCell setFrame:] in CKCalendarCell.o
  "_CGRectZero", referenced from:
      -[CKCalendarView _rectForCellsForDisplayMode:] in CKCalendarView.o
  "_CGSizeZero", referenced from:
      -[CKCalendarCell applyColorsForState:] in CKCalendarCell.o
  "_OBJC_CLASS_$_CALayer", referenced from:
      objc-class-ref in CKCalendarView.o
  "_OBJC_CLASS_$_CKDemoViewController", referenced from:
      objc-class-ref in CKAppDelegate.o
  "_OBJC_CLASS_$_UIApplication", referenced from:
      objc-class-ref in CKCalendarView.o
  "_OBJC_CLASS_$_UIBarButtonItem", referenced from:
      objc-class-ref in CKCalendarViewControllerInternal.o
  "_OBJC_CLASS_$_UIColor", referenced from:
      objc-class-ref in NSString+Color.o
      objc-class-ref in UIColor+HexString.o
      l_OBJC_$_CATEGORY_UIColor_$_HexString in UIColor+HexString.o
      objc-class-ref in UIView+Border.o
      objc-class-ref in CKCalendarCell.o
      objc-class-ref in CKCalendarHeaderView.o
      objc-class-ref in CKCalendarView.o
      ...
  "_OBJC_CLASS_$_UIFont", referenced from:
      objc-class-ref in CKCalendarCell.o
      objc-class-ref in CKCalendarHeaderView.o
  "_OBJC_CLASS_$_UIImage", referenced from:
      objc-class-ref in CKCalendarView.o
  "_OBJC_CLASS_$_UIImageView", referenced from:
      objc-class-ref in MBPolygonView.o
  "_OBJC_CLASS_$_UILabel", referenced from:
      objc-class-ref in CKCalendarCell.o
      objc-class-ref in CKCalendarHeaderView.o
  "_OBJC_CLASS_$_UILongPressGestureRecognizer", referenced from:
      objc-class-ref in MBPolygonView.o
  "_OBJC_CLASS_$_UINavigationController", referenced from:
      _OBJC_CLASS_$_CKCalendarViewController in CKCalendarViewController.o
  "_OBJC_CLASS_$_UIResponder", referenced from:
      _OBJC_CLASS_$_CKAppDelegate in CKAppDelegate.o
  "_OBJC_CLASS_$_UIScreen", referenced from:
      objc-class-ref in MBPolygonView.o
      objc-class-ref in CKAppDelegate.o
  "_OBJC_CLASS_$_UISegmentedControl", referenced from:
      objc-class-ref in CKCalendarViewControllerInternal.o
  "_OBJC_CLASS_$_UITableView", referenced from:
      objc-class-ref in CKCalendarView.o
  "_OBJC_CLASS_$_UITableViewCell", referenced from:
      objc-class-ref in CKCalendarView.o
  "_OBJC_CLASS_$_UITapGestureRecognizer", referenced from:
      objc-class-ref in CKCalendarHeaderView.o
  "_OBJC_CLASS_$_UIView", referenced from:
      objc-class-ref in UIView+AnimatedFrame.o
      l_OBJC_$_CATEGORY_UIView_$_AnimatedFrame in UIView+AnimatedFrame.o
      l_OBJC_$_CATEGORY_UIView_$_Border in UIView+Border.o
      _OBJC_CLASS_$_CKCalendarCell in CKCalendarCell.o
      objc-class-ref in CKCalendarCell.o
      _OBJC_CLASS_$_CKCalendarHeaderView in CKCalendarHeaderView.o
      objc-class-ref in CKCalendarView.o
      ...
  "_OBJC_CLASS_$_UIViewController", referenced from:
      _OBJC_CLASS_$_CKCalendarViewControllerInternal in CKCalendarViewControllerInternal.o
  "_OBJC_CLASS_$_UIWindow", referenced from:
      objc-class-ref in CKAppDelegate.o
  "_OBJC_METACLASS_$_UINavigationController", referenced from:
      _OBJC_METACLASS_$_CKCalendarViewController in CKCalendarViewController.o
  "_OBJC_METACLASS_$_UIResponder", referenced from:
      _OBJC_METACLASS_$_CKAppDelegate in CKAppDelegate.o
  "_OBJC_METACLASS_$_UIView", referenced from:
      _OBJC_METACLASS_$_CKCalendarCell in CKCalendarCell.o
      _OBJC_METACLASS_$_CKCalendarHeaderView in CKCalendarHeaderView.o
      _OBJC_METACLASS_$_CKCalendarView in CKCalendarView.o
      _OBJC_METACLASS_$_MBPolygonView in MBPolygonView.o
  "_OBJC_METACLASS_$_UIViewController", referenced from:
      _OBJC_METACLASS_$_CKCalendarViewControllerInternal in CKCalendarViewControllerInternal.o
  "_UIApplicationMain", referenced from:
      _main in main.o
  "_UIGraphicsBeginImageContextWithOptions", referenced from:
      -[MBPolygonView polyImage] in MBPolygonView.o
  "_UIGraphicsEndImageContext", referenced from:
      -[MBPolygonView polyImage] in MBPolygonView.o
  "_UIGraphicsGetCurrentContext", referenced from:
      -[MBPolygonView polyImage] in MBPolygonView.o
  "_UIGraphicsGetImageFromCurrentImageContext", referenced from:
      -[MBPolygonView polyImage] in MBPolygonView.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

1 个答案:

答案 0 :(得分:0)

首先将Xcode中此项目的部署目标更改为7.0或更高版本 然后在SwiftDemoViewController.swift

中该项目中的代码注释这一行
override init() {

        self.data = NSMutableDictionary()
        super.init()
    }