> ## Content Index
> Fetch the complete content index at: https://yinguobing.com/blog/llms.txt
> Use this file to discover other available public pages before exploring further.

# Dlib编译错误Converting std::__cxx11::string to std::string
- URL: https://yinguobing.com/blog/gcc5-linking-error-std-cxx11-string/
- Published: 2017-06-18T09:40:14.000Z
- Updated: 2022-05-29T08:50:43.000Z
- Description: 在编译Dlib的时候总是无法通过。引发错误的原因居然是Anaconda。
- Author: 尹国冰
- Tags: C++

在编译Dlib的时候总是无法通过，报错信息包含`Converting std::__cxx11::string to std::string`。

🤔

一开始以为是Dlib的问题，但是在github查询发现dlib的作者davis认为这个是编译器错误[\[1\]](#fn1)。以错误信息作为关键词继续检索在stackoverflow发现这样一则解释[\[2\]](#fn2)，原来是`gcc5.4`要求编译与链接的库文件采用统一的ABI版本[\[3\]](#fn3)。所以，技术`ldd`命令一看，`libstdc++.so.6`路径里居然有`Anaconda`！

反正也不常用，干脆卸载了它。然后就一切正常了。

理论上将Anaconda从系统PATH变量中去掉也可以，如果你遇到类似的问题不妨试试看。

# REF

---

1. [https://github.com/davisking/dlib/issues/440](https://github.com/davisking/dlib/issues/440?ref=yinguobing.com) [↩︎](#fnref1)
2. [http://stackoverflow.com/questions/33394934/converting-std-cxx11string-to-stdstring](http://stackoverflow.com/questions/33394934/converting-std-cxx11string-to-stdstring?ref=yinguobing.com) [↩︎](#fnref2)
3. [gcc关于ABI的说明](https://gcc.gnu.org/onlinedocs/libstdc++/manual/using%5Fdual%5Fabi.html?ref=yinguobing.com) [↩︎](#fnref3)