C ++链接问题,似乎我无法针对标准C ++东西进行链接 [英] C++ linking problems, seems like I can't link against standard C++ stuff

查看:91
本文介绍了C ++链接问题,似乎我无法针对标准C ++东西进行链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用自己在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.

但是,当我尝试在我的应用程序项目中链接到此lib时,该应用程序无法链接.链接错误使我感到惊讶;看起来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编译器5.0-语言-C ++"下,有一个"C ++标准库"的设置.需要将其值更改为"Compiler Default".

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆