由Swift不区分大小写的#import引起的头痛

时间:2015-02-01 22:21:48

标签: xcode swift linker-errors importerror

昨晚我将Swifter导入到我的项目中,但缺少像这样的符号

Undefined symbols for architecture arm64:
  "__TMdO10SwifterIOS4JSON", referenced from:
      __TMaGVSs10DictionarySSO10SwifterIOS4JSON_ in CWAppDelegate.o
  "__TMaC10SwifterIOS7Swifter", referenced from:
      __TFC9Chatswood13CWAppDelegate11applicationfS0_FTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVSs10DictionaryCSo8NSObjectPSs9AnyObject____Sb in CWAppDelegate.o
      __TMaGSqC10SwifterIOS7Swifter_ in CWAppDelegate.o
  "__TFC10SwifterIOS7SwifterCfMS0_FT7accountCSo9ACAccount_S0_", referenced from:
      __TFC9Chatswood13CWAppDelegate11applicationfS0_FTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVSs10DictionaryCSo8NSObjectPSs9AnyObject____Sb in CWAppDelegate.o
  "__TFC10SwifterIOS7Swifter22getUserStreamDelimitedfS0_FTGSqSb_13stallWarningsGSqSb_35includeMessagesFromFollowedAccountsGSqSb_14includeRepliesGSqSb_5trackGSqGSaSS__9locationsGSqGSaSS__18stringifyFriendIDsGSqSb_8progressGSqFT6statusGSqGVSs10DictionarySSOS_4JSON___T__19stallWarningHandlerGSqFT4codeGSqSS_7messageGSqSS_11percentFullGSqSi__T__7failureGSqFT5errorCSo7NSError_T___CS_18SwifterHTTPRequest", referenced from:
      __TFC9Chatswood13CWAppDelegate11applicationfS0_FTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVSs10DictionaryCSo8NSObjectPSs9AnyObject____Sb in CWAppDelegate.o

1 个答案:

答案 0 :(得分:0)

最后我发现这是因为误将#import SwifteriOS写入#import SwifterIOS而造成的。我想知道是否应该使用编译器(旧语言的预处理器)而不是链接器报告这一点,链接器的报告对于用户跟踪问题的根源并不清楚和提供信息。我认为Xcode混合了编译器,链接器甚至(崩溃的)SourceKitService编码助手的许多职责,尽管大多数意图和结果都是正面的。

欢迎进一步提示和讨论:)