2016-12-26 113 views
0

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

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) 
+0

你有一些问题:豆荚-TST-dummy.m请查看本福斯特。 –

+0

您最近对您的项目所做的更改是什么? –

+0

我找不到我的Pods-tst-dummy.m。你最近的变化是什么意思。我只是按照该网站的步骤 – Chandran

回答

0

我想你应该更新荚版本:

sudo gem install cocoapods 

此运行后:

pod update --verbose 
+0

对不起,它似乎没有工作 – Chandran

+0

现在这两个错误都是发生。 – Chandran

0

显然我有甚至在使用可可豆荚并禁用Bitcode之后单独添加TesseractOCR.framework。这防止了错误。

-1

由于Tesseract需要libstdC++。6.0.9.dylib(或libstdC++。6.0.9.tbd,如果libstdC++。6.0.9.dylib在您当前的Xcode版本中不可用)和CoreImage.framework,您需要将两个链接这些库的英寸。

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

enter image description here

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

enter image description here

相关问题