您尚未登录。

#1 2011-09-03 18:34:34

cuihao
所在地: USTC, Hefei
注册时间: 2011-08-19
帖子: 1,222
个人网站

C++的编译信息真是可恶

看了半天不明要旨,坑了我半个小时:

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: I-YU.ME   Twitter: @cuihaoleo   Org: LUG@USTC
AD:  ~欢迎参与志愿计算~

离线

#2 2011-09-03 20:11:52

phoenixlzx
晩ご飯だよー
注册时间: 2011-08-19
帖子: 1,789
个人网站

Re: C++的编译信息真是可恶

这个你要去问翻译...... :em06

离线

#3 2011-09-04 13:34:59

cjxgm
万年潜水的版主
所在地: 杭州
注册时间: 2011-08-19
帖子: 414
个人网站

Re: C++的编译信息真是可恶

clang?

离线

#4 2011-09-04 18:49:53

cuihao
所在地: USTC, Hefei
注册时间: 2011-08-19
帖子: 1,222
个人网站

Re: C++的编译信息真是可恶

cjxgm 说:

clang?

g++。
clang++试过,差不多,就是高亮显示了出错的内容。


Site: I-YU.ME   Twitter: @cuihaoleo   Org: LUG@USTC
AD:  ~欢迎参与志愿计算~

离线

#5 2011-09-10 06:50:13

QUO1991
GUNDAM
注册时间: 2011-08-26
帖子: 82
个人网站

Re: C++的编译信息真是可恶

直接思路不对,正在纠结的飘过一下。。。

离线

页脚