使用C++标准库时编译错误。。。

liken218 2006-08-27 06:31:09
错误信息如下:
"/usr/vacpp/include/iostream.h", line 443.32: 1540-0600 (S) The reference to "ios" is ambiguous.
"/usr/vacpp/include/iostream.h", line 78.7: 1540-0425 (I) "ios" is defined on line 78 of "/usr/vacpp/include/iostream.h".
"/usr/vacpp/include/iosfwd", line 330.45: 1540-0425 (I) "std::ios" is defined on line 330 of "/usr/vacpp/include/iosfwd".
"/usr/vacpp/include/iostream.h", line 692.32: 1540-0600 (S) The reference to "ios" is ambiguous.
"/usr/vacpp/include/iostream.h", line 78.7: 1540-0425 (I) "ios" is defined on line 78 of "/usr/vacpp/include/iostream.h".
"/usr/vacpp/include/iosfwd", line 330.45: 1540-0425 (I) "std::ios" is defined on line 330 of "/usr/vacpp/include/iosfwd".
"/usr/vacpp/include/iostream.h", line 873.25: 1540-0600 (S) The reference to "istream" is ambiguous.
"/usr/vacpp/include/iostream.h", line 443.7: 1540-0425 (I) "istream" is defined on line 443 of "/usr/vacpp/include/iostream.h".
"/usr/vacpp/include/iosfwd", line 332.49: 1540-0425 (I) "std::istream" is defined on line 332 of "/usr/vacpp/include/iosfwd".
"/usr/vacpp/include/iostream.h", line 881.35: 1540-0600 (S) The reference to "istream" is ambiguous.
"/usr/vacpp/include/iostream.h", line 443.7: 1540-0425 (I) "istream" is defined on line 443 of "/usr/vacpp/include/iostream.h".
"/usr/vacpp/include/iosfwd", line 332.49: 1540-0425 (I) "std::istream" is defined on line 332 of "/usr/vacpp/include/iosfwd".
"/usr/vacpp/include/iostream.h", line 893.35: 1540-0600 (S) The reference to "ostream" is ambiguous.
"/usr/vacpp/include/iostream.h", line 692.7: 1540-0425 (I) "ostream" is defined on line 692 of "/usr/vacpp/include/iostream.h".
"/usr/vacpp/include/iostream.h", line 74.7: 1540-0424 (I) "ostream" is declared on line 74 of "/usr/vacpp/include/iostream.h".
"/usr/vacpp/include/iosfwd", line 333.49: 1540-0425 (I) "std::ostream" is defined on line 333 of "/usr/vacpp/include/iosfwd".
"/usr/vacpp/include/iostream.h", line 905.36: 1540-0600 (S) The reference to "iostream" is ambiguous.
"/usr/vacpp/include/iostream.h", line 873.7: 1540-0425 (I) "iostream" is defined on line 873 of "/usr/vacpp/include/iostream.h".
"/usr/vacpp/include/iosfwd", line 334.50: 1540-0425 (I) "std::iostream" is defined on line 334 of "/usr/vacpp/include/iosfwd".
"/usr/vacpp/include/iostream.h", line 922.4: 1540-0040 (S) The text "&" is unexpected. "ios" may be undeclared or ambiguous.
"/usr/vacpp/include/iostream.h", line 923.8: 1540-0040 (S) The text "&" is unexpected. "ostream" may be undeclared or ambiguous.
"/usr/vacpp/include/iostream.h", line 924.8: 1540-0040 (S) The text "&" is unexpected. "ostream" may be undeclared or ambiguous.
"/usr/vacpp/include/iostream.h", line 925.8: 1540-0040 (S) The text "&" is unexpected. "ostream" may be undeclared or ambiguous.
"/usr/vacpp/include/iostream.h", line 926.4: 1540-0040 (S) The text "&" is unexpected. "ios" may be undeclared or ambiguous.
"/usr/vacpp/include/iostream.h", line 927.4: 1540-0040 (S) The text "&" is unexpected. "ios" may be undeclared or ambiguous.
"/usr/vacpp/include/iostream.h", line 928.8: 1540-0040 (S) The text "&" is unexpected. "istream" may be undeclared or ambiguous.

和非标准库混在一起了,怎么区分呢?用的是AIX xlC
...全文
453 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
chenhu_doc 2006-08-28
  • 打赏
  • 举报
回复
支持命名空间的引进

建议用:
#include<iostrem>

using namespace std;

代替.h的出现!
jixingzhong 2006-08-27
  • 打赏
  • 举报
回复
不要使用 .h 方式包含,
用 C++ 包含方式:

#include<iostrem>

using namespace std;
wei_feihong 2006-08-27
  • 打赏
  • 举报
回复
#include<iostrem>

using namespace std;
fangrk 2006-08-27
  • 打赏
  • 举报
回复
最好给出点源代码
liken218 2006-08-27
  • 打赏
  • 举报
回复
应该是引用的文件里有用的。而在头文件中用了using namespace std;
believefym 2006-08-27
  • 打赏
  • 举报
回复
ambiguous
OOPhaisky 2006-08-27
  • 打赏
  • 举报
回复
楼主是不是同时使用了<iostream>和<iostream.h>了?
chenhu_doc 2006-08-27
  • 打赏
  • 举报
回复
命名空间出了问题吧!

64,654

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧