编译C++代码出现下面错误no type named ‘iterator_category’ in ‘class std::vector<double>’ 20
Infileincludedfrom/usr/include/c++/4.6/bits/stl_algobase.h:66:0,from/usr/include/c++/...
In file included from /usr/include/c++/4.6/bits/stl_algobase.h:66:0,
from /usr/include/c++/4.6/bits/char_traits.h:41,
from /usr/include/c++/4.6/ios:41,
from /usr/include/c++/4.6/ostream:40,
from /usr/include/c++/4.6/iostream:40,
from lineartrend_notest.cpp:7:
/usr/include/c++/4.6/bits/stl_iterator_base_types.h: 在全局域:
/usr/include/c++/4.6/bits/stl_iterator_base_types.h:在‘std::iterator_traits<std::vector<double> >’的实例化中:
/usr/include/c++/4.6/bits/stl_vector.h:1090:24:自‘void std::vector<_Tp, _Alloc>::_M_initialize_dispatch(_InputIterator, _InputIterator, std::__false_type) [with _InputIterator = std::vector<double>, _Tp = std::vector<double>, _Alloc = std::allocator<std::vector<double> >]’实例化
/usr/include/c++/4.6/bits/stl_vector.h:340:4:自‘std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with _InputIterator = std::vector<double>, _Tp = std::vector<double>, _Alloc = std::allocator<std::vector<double> >, std::vector<_Tp, _Alloc>::allocator_type = std::allocator<std::vector<double> >]’实例化
xg_math_stat.h:320:116:自‘regress2<T>::regress2(const std::vector<T>&, const std::vector<T>&) [with T = double]’实例化
lineartrend_notest.cpp:26:28:从此处实例化
/usr/include/c++/4.6/bits/stl_iterator_base_types.h:166:53: 错误: no type named ‘iterator_category’ in ‘class std::vector<double>’
我知道应该是命名空间出了问题,但不知道到底哪里有问题 展开
from /usr/include/c++/4.6/bits/char_traits.h:41,
from /usr/include/c++/4.6/ios:41,
from /usr/include/c++/4.6/ostream:40,
from /usr/include/c++/4.6/iostream:40,
from lineartrend_notest.cpp:7:
/usr/include/c++/4.6/bits/stl_iterator_base_types.h: 在全局域:
/usr/include/c++/4.6/bits/stl_iterator_base_types.h:在‘std::iterator_traits<std::vector<double> >’的实例化中:
/usr/include/c++/4.6/bits/stl_vector.h:1090:24:自‘void std::vector<_Tp, _Alloc>::_M_initialize_dispatch(_InputIterator, _InputIterator, std::__false_type) [with _InputIterator = std::vector<double>, _Tp = std::vector<double>, _Alloc = std::allocator<std::vector<double> >]’实例化
/usr/include/c++/4.6/bits/stl_vector.h:340:4:自‘std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with _InputIterator = std::vector<double>, _Tp = std::vector<double>, _Alloc = std::allocator<std::vector<double> >, std::vector<_Tp, _Alloc>::allocator_type = std::allocator<std::vector<double> >]’实例化
xg_math_stat.h:320:116:自‘regress2<T>::regress2(const std::vector<T>&, const std::vector<T>&) [with T = double]’实例化
lineartrend_notest.cpp:26:28:从此处实例化
/usr/include/c++/4.6/bits/stl_iterator_base_types.h:166:53: 错误: no type named ‘iterator_category’ in ‘class std::vector<double>’
我知道应该是命名空间出了问题,但不知道到底哪里有问题 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询