我正在尝试构建NewsYC iOS app。我可以让它在模拟器中工作,但当我瞄准我的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)
答案 0 :(得分:1)
在终端中执行git submodule init; git submodule update
后,在newsyc项目的文件导航器中选择HNKit.xcocdeproj。然后单击“构建设置”,然后您应该在“仅构建活动体系结构”旁边看到“多个值”。单击它并将其设置为“NO”。