分页: 1 / 1

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

发表于 : 2005-11-01 5:11
liebermich
我每次用命令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查看结果,总是不能看到,真的是很困惑哦,请求大家帮助,谢谢.

发表于 : 2005-11-01 8:51
eexpress
提示说的清楚啊。要用前面的<>的头文件代替后面那个<>里面的,就没有警告。

发表于 : 2005-11-01 9:41
zhan
就是说c++里面的头文件是通常没有.h的后缀的,同时如果引用的是c中的文件的话一般是在前面加上c,后面去掉.h.比如常用的c 中的<stdlib.h>,在c++中应写为
<cstdlib>,同时不要忘了加上一句using namespace std;
具体的可以查一查 关于c++的书籍,基本上每一本都会讲的。

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

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