- 论坛徽章:
- 0
|
stl书上的例子:
编译通不过,出现如下错误:
yxb@yxb-desktop:~/stl/stl$ g++ ioiter1.cpp -o exe
ioiter1.cpp: In function ‘int main()’:
ioiter1.cpp:14: 错误: ‘istream_iterator’在此作用域中尚未声明
ioiter1.cpp:14: 错误: expected primary-expression before ‘>’ token
ioiter1.cpp:15: 错误: expected primary-expression before ‘>’ token
ioiter1.cpp:15: 错误: expected primary-expression before ‘)’ token
ioiter1.cpp:16: 错误: ‘back_iterator’在此作用域中尚未声明
ioiter1.cpp:21: 错误: ‘ostream_iterator’在此作用域中尚未声明
ioiter1.cpp:21: 错误: expected primary-expression before ‘>’ token
上网查了下发现说是要加上命名空间std,可是我原本就有加,怎么不行 |
-
1.jpg
(102.16 KB, 下载次数: 34)
|