LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 868|回复: 14

help about g++

[复制链接]
发表于 2003-3-25 11:51:01 | 显示全部楼层 |阅读模式
[fresher@HRC prgm]$ g++ -o t1 t1.cpp
In file included from /usr/include/c++/3.2/backward/iostream.h:31,
                 from t1.cpp:1:
/usr/include/c++/3.2/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 <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.

what's that mean?
 楼主| 发表于 2003-3-25 18:26:47 | 显示全部楼层
怎么没人帮帮我?
上面那些提示什么意思?
发表于 2003-3-25 19:06:43 | 显示全部楼层
警告而已,建议你最好使用<iostream>而不是<iostream.h>。
 楼主| 发表于 2003-3-26 01:19:51 | 显示全部楼层
最初由 kj501 发布
警告而已,建议你最好使用<iostream>而不是<iostream.h>。

用 iostream的时候,提示又变成如下这些了:

[fresher@HRC prgm]$ g++ -o t2 t2.cpp
t2.cpp: In function `int main()':
t2.cpp:5: `cout' undeclared (first use this function)
t2.cpp:5: (Each undeclared identifier is reported only once for each function
   it appears in.)
t2.cpp:5: `endl' undeclared (first use this function)
[fresher@HRC prgm]$
发表于 2003-3-26 03:11:38 | 显示全部楼层
这样的英文查查字典就可以知道意思了呀
发表于 2003-3-26 07:10:02 | 显示全部楼层
#include <iostream>

using namespace std;

int
main(void)
{.......
 楼主| 发表于 2003-3-26 11:25:23 | 显示全部楼层
最初由 libinary 发布
#include <iostream>
            ~~~~~~~~~~~~~~~~~~改成这种不行啊,编译通不过  

using namespace std;

int
main(void)
{.......
发表于 2003-3-27 03:54:00 | 显示全部楼层
怎么个通不过法,提示
发表于 2003-3-27 14:33:32 | 显示全部楼层
把cout改成std::cout,把endl改成std::endl。
发表于 2003-3-30 13:21:50 | 显示全部楼层
这下总该成功了吧?:)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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