C ++链接问题,似乎我不能链接到标准的C ++东西 [英] C++ linking problems, seems like I cant link against standard C++ stuff
问题描述
我想使用我在iOS应用程式中编译的图书馆。库是Tesseract OCR库。看起来像编译(和它的依赖)已经确定。
I am trying to use a library I've compiled myself in an iOS app. The library is the Tesseract OCR lib. It seems like compiling that (and its dependencies) have gone ok.
但是,当我尝试在我的应用程序项目中链接到这个库时,应用程序无法链接。链接错误让我惊讶;它似乎有问题的Tesseract东西找到漂亮的标准C ++的东西。
However, when I try to link against this lib in my app project, the app fails to link. The link errors surprise me; it seems like there are problems with the Tesseract stuff finding pretty standard C++ stuff.
关于我可能做错的任何建议将是最有帮助的。
Any suggestions about what I might be doing wrong would be most helpful.
这是我看到的链接错误类型的代码段。
Here is a snippet of the kind of link errors I'm seeing.
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)
推荐答案
谢谢你大家的答案。我发现了我的特定问题,所以会在这里分享它,以防任何人打它。
Thank you everyone for your answers. I found out what my particular problem was, so will share it here in case anybody else hits it.
我的问题是一个项目构建设置。在Apple LLVM Compiler 5.0 - Language - C ++下,有一个C ++标准库的设置。其值需要更改为编译器默认值。
My problem was a project build setting. Under "Apple LLVM Compiler 5.0 - Language - C++" there is a setting for "C++ standard library". Its value needed to be changed to "Compiler Default".
几小时浪费,但问题解决了!
Several hours wasted, but problem solved!
这篇关于C ++链接问题,似乎我不能链接到标准的C ++东西的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!