页次: 1
看了半天不明要旨,坑了我半个小时:
dbxtj.cpp: 在函数‘int main()’中:
In file included from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1/bits/stl_algobase.h:66:0,
from /usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1/vector:61,
from dbxtj.cpp:3:
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1/bits/stl_iterator_base_types.h: 在全局域:
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1/bits/stl_iterator_base_types.h:在‘std::iterator_traits<coord>’的实例化中:
dbxtj.cpp:98:34:从此处实例化
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1/bits/stl_iterator_base_types.h:166:53: 错误:no type named ‘iterator_category’ in ‘struct coord’
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1/bits/stl_iterator_base_types.h:167:53: 错误:no type named ‘value_type’ in ‘struct coord’
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1/bits/stl_iterator_base_types.h:168:53: 错误:no type named ‘difference_type’ in ‘struct coord’
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1/bits/stl_iterator_base_types.h:169:53: 错误:no type named ‘pointer’ in ‘struct coord’
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1/bits/stl_iterator_base_types.h:170:53: 错误:no type named ‘reference’ in ‘struct coord’
我一直以为是我的vector的用法出了问题…… 最后上网查了才知道是我的程序里某个函数名distance和STL的冲突了……
直接说名称冲突不久行了…… :em20
Site: CVHC.CC Twitter: @cuihaoleo Org: LUG@USTC
AD: ~欢迎参与志愿计算~
离线
离线
clang?
Giumo Clanjor (哆啦比猫/兰威举)
Where there is a hacker, there is art. | Dogfooding myself. (C++ / Lua / Perl / Rust)
离线
clang?
g++。
clang++试过,差不多,就是高亮显示了出错的内容。
Site: CVHC.CC Twitter: @cuihaoleo Org: LUG@USTC
AD: ~欢迎参与志愿计算~
离线
离线
页次: 1