架构为armv7的Swift出现未定义符号

7

我最近升级到Xcode 6 Beta 6,现在在一个之前在Beta 5上正常运行的应用程序中遇到这些错误。我一直在检查每个方法,并注释掉导致问题的那一行代码,但应该有另一种解决方案。以下是日志:

Undefined symbols for architecture armv7:
  "__TFSs26_forceBridgeFromObjectiveCU__FTPSs9AnyObject_MQ__Q_", referenced from:
      __TFC9BookSmart32AdvanceDetailTableViewController11viewDidLoadfS0_FT_T_ in AdvanceDetailTableViewController.o
      __TFC9BookSmart32AdvanceDetailTableViewController27numberOfSectionsInTableViewfS0_FGSqCSo11UITableView_Si in AdvanceDetailTableViewController.o
      __TFC9BookSmart33AdvancesNewLocationViewController12returnedDatafS0_FCSo12NSDictionaryT_ in AdvancesNewLocationViewController.o
      __TFC9BookSmart31ArtistDetailTableViewController19scrollViewDidScrollfS0_FGSQCSo12UIScrollView_T_ in ArtistDetailTableViewController.o
      __TFC9BookSmart31ArtistDetailTableViewController14viewWillAppearfS0_FSbT_ in ArtistDetailTableViewController.o
      __TFC9BookSmart31ArtistDetailTableViewController11viewDidLoadfS0_FT_T_ in ArtistDetailTableViewController.o
      __TFC9BookSmart18ChatViewController11viewDidLoadfS0_FT_T_ in ChatViewController.o
      ...
  "__TFSs15_arrayForceCastU___FGSaQ__GSaQ0__", referenced from:
      __TFFC9BookSmart33AdvanceSectionTableViewController9tableViewFS0_FTCSo11UITableView21cellForRowAtIndexPathCSo11NSIndexPath_GSqCSo15UITableViewCell_U_FTGSQCSo21MKLocalSearchResponse_GSQCSo7NSError__T_ in AdvanceSectionTableViewController.o
      __TFFFC9BookSmart33AdvanceSectionTableViewController9tableViewFS0_FTCSo11UITableView21cellForRowAtIndexPathCSo11NSIndexPath_GSqCSo15UITableViewCell_U_FTGSQCSo21MKLocalSearchResponse_GSQCSo7NSError__T_U_FTGSQCSo13MKMapSnapshot_GSQS5___T_ in AdvanceSectionTableViewController.o
      __TFC9BookSmart32AdvanceDetailTableViewController11viewDidLoadfS0_FT_T_ in AdvanceDetailTableViewController.o
      __TFC9BookSmart32AdvanceDetailTableViewController9tableViewfS0_FTGSQCSo11UITableView_18commitEditingStyleOSC27UITableViewCellEditingStyle17forRowAtIndexPathGSQCSo11NSIndexPath__T_ in AdvanceDetailTableViewController.o
      __TFC9BookSmart32AdvanceDetailTableViewController17createAdvanceInfofS0_FTGVSs10DictionarySSSS_6forKeySS5andIdSS_T_ in AdvanceDetailTableViewController.o
      __TFC9BookSmart33AdvancesNewLocationViewController21textFieldShouldReturnfS0_FCSo11UITextFieldSb in AdvancesNewLocationViewController.o
      __TFFC9BookSmart33AdvancesNewLocationViewController21textFieldShouldReturnFS0_FCSo11UITextFieldSbU_FTGSQCSo21MKLocalSearchResponse_GSQCSo7NSError__T_ in AdvancesNewLocationViewController.o
      ...
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

你尝试过清理或清空构建文件夹吗? - HAS
1
一个常见的beta 6迁移问题。请参阅:突然在Swift XCode beta 6中出现编译器崩溃"arrayForceCast" - Alex Wayne
你是如何解决这个问题的,因为你遇到了相同的问题? - user1408682
1个回答

26

Beta 6有一些重大变化,看起来Xcode感到困惑。进行完整清洁也没有用。

我通过删除Derived文件夹的内容解决了这个和其他类似难以理解的错误。您可以通过转到首选项>位置找到该文件夹的位置。

默认路径为:/Users/[你的用户名]/Library/Developer/Xcode/DerivedData


谢谢!那个救了我很多麻烦! - fuiiii
我已经尝试过这个方法,但对我无效。在Xcode 6 GM下仍然无法链接。有什么想法吗? - davidethell
这对我在 XCode 6 GM 上起作用。我遇到了找不到 RawOptionSetType 符号的问题。 - Mark Horgan
使用GM时,有时也会出现这个奇怪的错误。有什么想法吗? - Vanya

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接