簡體   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>'

定制的clang 3.1無法從libc ++中找到一些與機器相關的包含文件(例如bits/c++config.h ),因此我不得不手動添加: -I/usr/include/x86_64-linux-gnu/c++/4.8進入命令行。 gcc找不到這些文件沒有問題。

現在,我正在嘗試使用clang ++編譯文件。 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版本3.1目標:x86_64-unknown-linux-gnu線程模型:posix

gcc(Ubuntu 4.8.2-19ubuntu1)4.8.2

我應該如何進行進一步調查? 什么信息在這里有用?

升級您的clang版本, clang 3.1很可能無法處理4.8 libstdc++標頭。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM