请求强烈帮助我的C++的人编译问题,困扰已久啊

软件和网站开发以及相关技术探讨
回复
liebermich
帖子: 2
注册时间: 2005-11-01 5:03

请求强烈帮助我的C++的人编译问题,困扰已久啊

#1

帖子 liebermich » 2005-11-01 5:11

我每次用命令g++ (文件命) 编译的时候,都会出现以下错误
In file included from /usr/include/c++/3.3/backward/iostream.h:31,
from 2.cc:1:
/usr/include/c++/3.3/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.

然后我调用a.out查看结果,总是不能看到,真的是很困惑哦,请求大家帮助,谢谢.
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

#2

帖子 eexpress » 2005-11-01 8:51

提示说的清楚啊。要用前面的<>的头文件代替后面那个<>里面的,就没有警告。
● 鸣学
头像
zhan
帖子: 1880
注册时间: 2005-08-15 0:04
来自: 南7技校

#3

帖子 zhan » 2005-11-01 9:41

就是说c++里面的头文件是通常没有.h的后缀的,同时如果引用的是c中的文件的话一般是在前面加上c,后面去掉.h.比如常用的c 中的<stdlib.h>,在c++中应写为
<cstdlib>,同时不要忘了加上一句using namespace std;
具体的可以查一查 关于c++的书籍,基本上每一本都会讲的。
guile
帖子: 9
注册时间: 2005-09-28 1:38
来自: linux公社
联系:

哈哈,又一个不知道标准模板库的

#4

帖子 guile » 2005-11-08 0:07

标准模板库是不久之前(哪一年)才达成一致的。以后看书一定要注意,里面有没有提到标准模板库,如果没有提到。那么,几乎就可以肯定地说,这本书作废了。
回复