简体   繁体   English

铛错误:c ++ / 4.8 / bits / stl_iterator_base_types.h:227:29:错误:&#39;std :: iterator_traits中没有名为&#39;iterator_category&#39;的类型 <unsigned long> “

[英]clang error: c++/4.8/bits/stl_iterator_base_types.h:227:29: error: no type named 'iterator_category' in 'std::iterator_traits<unsigned long>'

Custom built clang 3.1 was unable to find some machine-dependent include files(like bits/c++config.h ) from libc++, so I had to add manually: -I/usr/include/x86_64-linux-gnu/c++/4.8 into command line. 定制的clang 3.1无法从libc ++中找到一些与机器相关的包含文件(例如bits/c++config.h ),因此我不得不手动添加: -I/usr/include/x86_64-linux-gnu/c++/4.8进入命令行。 gcc has no problem finding those files. gcc找不到这些文件没有问题。

Now I am trying to compile a file with clang++. 现在,我正在尝试使用clang ++编译文件。 gcc(with the same options) compiles it, complaining only with a bunch of warnings, when clang++ unable to do that, referring to an error in the standard library: gcc(具有相同的选项)编译它,当clang ++无法做到这一点时,只发出一堆警告,引用标准库中的错误:

In file included from /home/necto/proj/klein/lib/Core/PPLSupport.cpp:2:
In file included from /home/necto/proj/klein/build/llvm/include/llvm/Constant.h:17:
In file included from /home/necto/proj/klein/build/llvm/include/llvm/User.h:22:
In file included from /home/necto/proj/klein/build/llvm/include/llvm/Support/ErrorHandling.h:19:
In file included from /home/necto/proj/klein/build/llvm/include/llvm/ADT/StringRef.h:18:
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/string:39:
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/char_traits.h:38:
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_algobase.h:65:
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_iterator_base_types.h:227:29: error: no type named 'iterator_category' in 'std::iterator_traits<unsigned long>'
            iterator_traits<_InIter>::iterator_category,
            ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_vector.h:391:25: note: in instantiation of template type alias '_RequireInputIter' requested here
           typename = std::_RequireInputIter<_InputIterator>>
                           ^
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_vector.h:392:9: note: in instantiation of default argument for 'vector<unsigned long>' required here
    vector(_InputIterator __first, _InputIterator __last,
    ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/stl_vector.h:392:9: note: while substituting deduced template arguments into function template 'vector' [with _InputIterator = unsigned long, $1 = ]
    vector(_InputIterator __first, _InputIterator __last,

clang version 3.1 Target: x86_64-unknown-linux-gnu Thread model: posix clang版本3.1目标:x86_64-unknown-linux-gnu线程模型:posix

gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2 gcc(Ubuntu 4.8.2-19ubuntu1)4.8.2

How should I proceed in further investigation? 我应该如何进行进一步调查? What information would be useful here? 什么信息在这里有用?

Upgrade your clang version, it's very likely that clang 3.1 can't deal with the 4.8 libstdc++ headers. 升级您的clang版本, clang 3.1很可能无法处理4.8 libstdc++标头。

http://llvm.org/releases/download.html http://llvm.org/releases/download.html
http://llvm.org/apt http://llvm.org/apt

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 遇到错误:“struct std::iterator_traits”中没有名为“iterator_category”的类型<std::vector<int> &gt; - Encountring error: no type named ‘iterator_category’ in ‘struct std::iterator_traits<std::vector<int> > “struct std::iterator_traits”中没有名为“iterator_category”的类型<int* const> '</int*> - No type named 'iterator_category' in 'struct std::iterator_traits<int* const>' std::iterator_traits 中的 iterator_category 与 iterator_category() 有什么区别 - What is a difference between iterator_category vs iterator_category() in std::iterator_traits iterator_category&#39;:不是&#39;std :: iterator_traits &lt;_InIt&gt;&#39;的任何基类的成员 - iterator_category': is not a member of any base class of 'std::iterator_traits<_InIt>' std :: vector中没有名为iterator_category的类型 - No type named iterator_category in std::vector C ++在&#39;struct std :: iterator_traits中没有名为&#39;value_type&#39;的类型 <int> “ - C++ no type named ‘value_type’ in ‘struct std::iterator_traits<int>' “struct std::iterator_traits”中没有名为“value_type”的类型 - no type named ‘value_type’ in ‘struct std::iterator_traits 在struct std :: iterator_traits &lt;...&gt;中没有名为“ pointer”的类型 - no type named ‘pointer’ in struct std::iterator_traits<…> 使用std :: iterator_traits &lt;&gt;时出现不清楚的编译时错误 - Unclear compile time error when using std::iterator_traits<> cpp std::copy 编译期间出现问题:在“struct std::iterator_traits”中没有名为“value_type”的类型<unsigned_char> - cpp std::copy problems during compilation : no type named 'value_type' in 'struct std::iterator_traits<unsigned_char>
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM