【问题标题】:Mach-O Linker Error - files Imported(and checked) properly but still error?Mach-O 链接器错误 - 正确导入(和检查)文件但仍然错误?
【发布时间】:2014-11-23 10:52:52
【问题描述】:

我知道已经有无数的 Mach-O Linker 错误帖子,我已经查看了至少十几个试图找到解决问题的方法。许多解决方案评论说我必须“选中该框”或检查编译源以确保正确导入我的 .m 文件,是的,我做了所有这些。我已经在这几个小时了,我似乎无法从以下错误中做出任何事情:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_JSQMessage", referenced from:
  objc-class-ref in ChatView.o
  "_OBJC_CLASS_$_JSQMessagesAvatarImageFactory", referenced from:
  objc-class-ref in ChatView.o
  "_OBJC_CLASS_$_JSQMessagesBubbleImageFactory", referenced from:
  objc-class-ref in ChatView.o
  "_OBJC_CLASS_$_JSQMessagesTimestampFormatter", referenced from:
  objc-class-ref in ChatView.o
  "_OBJC_CLASS_$_JSQMessagesViewController", referenced from:
  _OBJC_CLASS_$_ChatView in ChatView.o
  "_OBJC_CLASS_$_JSQPhotoMediaItem", referenced from:
  objc-class-ref in ChatView.o
  "_OBJC_CLASS_$_JSQSystemSoundPlayer", referenced from:
  objc-class-ref in ChatView.o
  "_OBJC_METACLASS_$_JSQMessagesViewController", referenced from:
  _OBJC_METACLASS_$_ChatView in ChatView.o
  "_kJSQMessagesCollectionViewCellLabelHeightDefault", referenced from:
  -[ChatView collectionView:layout:heightForCellTopLabelAtIndexPath:] in ChatView.o
  -[ChatView collectionView:layout:heightForMessageBubbleTopLabelAtIndexPath:] in ChatView.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

对于解决上述错误的任何帮助或建议将不胜感激,并最终让我从这个令人抓狂的路障中继续前进。提前谢谢!

【问题讨论】:

  • 我有同样的错误..你找到解决办法了吗?

标签: ios objective-c xcode compiler-errors linker-errors


【解决方案1】:

我在通过 Cocoapods 使用这个库时遇到了同样的错误。我在执行pod install时注意到了这个警告信息:

[!] Application [Debug] 目标覆盖 OTHER_LDFLAGS `Pods/Target Support 中定义的构建设置 文件/Pods/Pods.debug.xcconfig'。这可能会导致问题 CocoaPods 安装

我在项目的构建设置中将$(inherited) 添加到OTHER_LDFLAGS 并解决了问题!

【讨论】:

    【解决方案2】:

    您似乎缺少相关的“框架”。文档是否指定了所需的框架。我猜它需要消息传递。

    【讨论】:

    • 有一个 JSQMessagesViewController 但只需要引入文件夹即可。不需要框架。有什么想法吗?
    猜你喜欢
    • 1970-01-01
    • 2014-04-06
    • 2012-12-21
    • 2023-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多