我正在尝试在iOS应用程序中使用我自己编译的库,这个库是Tesseract OCR库。 编译该库(以及它的依赖项)似乎已经成功了。
但是,当我尝试在我的应用程序项目中链接到这个库时,应用程序无法链接。链接错误让我感到惊讶;似乎Tesseract有问题找到相当标准的C++东西。
请问是否有任何建议可以帮助我解决这个问题?以下是我看到的一些链接错误片段。
但是,当我尝试在我的应用程序项目中链接到这个库时,应用程序无法链接。链接错误让我感到惊讶;似乎Tesseract有问题找到相当标准的C++东西。
请问是否有任何建议可以帮助我解决这个问题?以下是我看到的一些链接错误片段。
Undefined symbols for architecture armv7:
"std::string::find_last_of(char const*, unsigned long) const", referenced from:
tesseract::WordSizeModel::Init(std::string const&, std::string const&) in libtesseract.a(word_size_model.o)
"std::string::find_first_of(std::string const&, unsigned long) const", referenced from:
tesseract::CubeUtils::SplitStringUsing(std::string const&, std::string const&, std::vector<std::string, std::allocator<std::string> >*) in libtesseract.a(cube_utils.o)
"std::string::find_first_not_of(std::string const&, unsigned long) const", referenced from:
tesseract::CubeUtils::SplitStringUsing(std::string const&, std::string const&, std::vector<std::string, std::allocator<std::string> >*) in libtesseract.a(cube_utils.o)
"std::string::data() const", referenced from:
tesseract::CubeUtils::SplitStringUsing(std::string const&, std::string const&, std::vector<std::string, std::allocator<std::string> >*) in libtesseract.a(cube_utils.o)
"std::string::find(char, unsigned long) const", referenced from:
tesseract::TessLangModel::IsLeadingPunc(int) in libtesseract.a(tess_lang_model.o)
libstdc++
。您可能需要检查ldd
对libtesseract.a
的输出。http://unixhelp.ed.ac.uk/CGI/man-cgi?ldd+1 - Geoff MonteeViewController.m
(单个m)重命名为ViewController.mm
(双重m)来解决了问题。说实话,我不确定为什么会奏效。我猜测它在编译过程中以某种方式涉及到C++编译器,并迫使其使用所有正确的路径。 - iutinvg