2

我正在尝试构建NewsYC iOS 应用程序。我可以让它在模拟器中工作,但是当我瞄准我的 iPhone 5 时,我得到一个未定义的符号错误。我对 XCode 和 Objective C 很陌生,所以我不确定如何解决这个问题。我已经阅读了一些关于其他项目的错误信息,并在构建阶段链接了 libHNKit。不太确定还需要发生什么来纠正这个问题。

这是错误:

ld: warning: ignoring file /Users/stephenwalker/Library/Developer/Xcode/DerivedData/newsyc-gidnwqwyaspbjdevgkudlemjssmd/Build/Products/Debug-iphoneos/libHNKit.a, file was built for archive which is not the architecture being linked (armv7): /Users/stephenwalker/Library/Developer/Xcode/DerivedData/newsyc-gidnwqwyaspbjdevgkudlemjssmd/Build/Products/Debug-iphoneos/libHNKit.a
Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_HNAnonymousSession", referenced from:
      objc-class-ref in SessionListController.o
  "_OBJC_CLASS_$_HNSessionAuthenticator", referenced from:
      objc-class-ref in HackerNewsLoginController.o
  "_OBJC_CLASS_$_HNNetworkActivityController", referenced from:
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_HNAPISearch", referenced from:
      objc-class-ref in SearchController.o
  "_OBJC_CLASS_$_HNSession", referenced from:
      objc-class-ref in HackerNewsLoginController.o
  "_OBJC_CLASS_$_HNSessionController", referenced from:
      objc-class-ref in MainTabBarController.o
      objc-class-ref in SessionProfileController.o
      objc-class-ref in AppDelegate.o
      objc-class-ref in HackerNewsLoginController.o
      objc-class-ref in SessionListController.o
  "_OBJC_CLASS_$_HNObjectBodyRenderer", referenced from:
      objc-class-ref in AppDelegate.o
  "_OBJC_CLASS_$_HNSubmission", referenced from:
      objc-class-ref in CommentListController.o
      objc-class-ref in EntryReplyComposeController.o
      objc-class-ref in SubmissionTextComposeController.o
      objc-class-ref in SubmissionURLComposeController.o
  "_OBJC_CLASS_$_HNEntryList", referenced from:
      objc-class-ref in MainTabBarController.o
      objc-class-ref in MoreController.o
      objc-class-ref in ProfileController.o
      objc-class-ref in SessionProfileController.o
  "_OBJC_CLASS_$_HNEntry", referenced from:
      objc-class-ref in CommentListController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
4

1 回答 1

1

从终端完成后git submodule init; git submodule update,在 newsyc 项目的文件导航器中选择 HNKit.xcocdeproj。然后单击“构建设置”,然后您应该会在“仅构建活动架构”旁边看到“多个值”。单击它并将其设置为“否”。

于 2013-04-01T04:22:09.593 回答