找回密码
 注册
查看: 619|回复: 2

编译以c++时,为什么会有这样的警告?在线等?谢谢。

[复制链接]
发表于 2005-7-7 22:20:11 | 显示全部楼层 |阅读模式
[root@localhost 4]# g++ -o 4.2.1 4.2.1.cpp
In file included from /usr/lib/gcc/i386-redhat-linux/4.0.0/../../../../include/c++/4.0.0/backward/iostream.h:31,
                 from 4.2.1.cpp:1:
/usr/lib/gcc/i386-redhat-linux/4.0.0/../../../../include/c++/4.0.0/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
发表于 2005-7-7 22:47:06 | 显示全部楼层
#include <iostream>

not

#include <iostream.h>

就是说包含时不带.h

旧的定义都是.h,后来全去掉了。
回复

使用道具 举报

发表于 2005-7-7 23:12:39 | 显示全部楼层
如果你是用VC的话, 还是忍受一下不标准的吧
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2025-7-23 23:57 , Processed in 0.041073 second(s), 16 queries .

© 2001-2025 Discuz! Team. Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表