【问题标题】:Undefined symbols for architecture x86_64 when using Tesseract使用 Tesseract 时架构 x86_64 的未定义符号
【发布时间】:2017-03-30 01:12:56
【问题描述】:

我正在使用谷歌提供的 tesseract。在遵循this 教程之后,我终于完成了我的应用程序。但是,当我运行它时,我遇到了未定义符号的问题。这是错误

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_G8Tesseract", referenced from:
      objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我该如何解决这个问题?我尝试在线搜索,但没有一个解决方案对我有用。我尝试重新安装 Pod 并对其进行更新。然后我遇到了这个错误

clang: error: no such file or directory: '/Users/admin/Desktop/tst/Pods/Target Support Files/Pods-tst/Pods-tst-dummy.m'
clang: error: no input files

当我尝试重做项目时,我得到了他的错误

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_G8Tesseract", referenced from:
      objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

【问题讨论】:

  • 你有一些问题:Pods-tst-dummy.m 请检查这个forst。
  • 您最近对项目做了哪些更改??
  • 我找不到我的 Pods-tst-dummy.m。最近的变化是什么意思。我只是按照该网站上的步骤进行操作
  • 尝试:pod update --verbose
  • 感谢它首先帮助解决了第一个错误。但是现在ld: library not found for -lPods-test 出现了这个错误

标签: ios xcode tesseract arm64


【解决方案1】:

显然,即使在使用可可豆荚并禁用 Bitcode 之后,我也必须单独添加 TesseractOCR.framework。这防止了错误。

【讨论】:

    【解决方案2】:

    我认为你应该更新 pod 版本:

    sudo gem install cocoapods
    

    运行后:

    pod update --verbose
    

    【讨论】:

      【解决方案3】:

      由于 Tesseract 需要 libstdc++.6.0.9.dylib(如果 libstdc++.6.0.9.dylib 在当前 Xcode 版本中不可用,则需要 libstdc++.6.0.9.tbd)和 CoreImage.framework,因此您需要将两者链接这些库。

      在“常规”选项卡中,向下滚动到“链接框架和库”。

      这里应该只有一个文件:TesseractOCR.framework,你刚刚添加的。单击列表下方的 + 按钮。找到 libstdc++.dylib(或 libstdc++.6.0.9.tbd)和 CoreImage.framework 并将它们添加到您的项目中。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2014-08-07
        • 2012-07-20
        • 1970-01-01
        • 2015-08-23
        • 2014-05-27
        • 2017-07-06
        • 2016-06-20
        相关资源
        最近更新 更多