当前位置: 技术问答>linux和unix
c++编译总提示这个是什么意思??
来源: 互联网 发布时间:2016-02-01
本文导语: [xxx@localhost cpp]$ g++ main.cpp In file included from /usr/include/c++/3.2.2/backward/iostream.h:31,form main.cpp:1: /usr/include/c++3.2.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header.Please ...
[xxx@localhost cpp]$ g++ main.cpp
In file included from /usr/include/c++/3.2.2/backward/iostream.h:31,form main.cpp:1:
/usr/include/c++3.2.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header.Please consider using one of 32 headers found in section 17.4.1.2 of the c++ standard. Examples include substituting the header for the header for c++ includes,or instead of the deprecated header . To disable this warning use -Who-deprecated.
[xxx@localhost cpp]$
这个Warning是什么意思,请前辈们指点一下
In file included from /usr/include/c++/3.2.2/backward/iostream.h:31,form main.cpp:1:
/usr/include/c++3.2.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header.Please consider using one of 32 headers found in section 17.4.1.2 of the c++ standard. Examples include substituting the header for the header for c++ includes,or instead of the deprecated header . To disable this warning use -Who-deprecated.
[xxx@localhost cpp]$
这个Warning是什么意思,请前辈们指点一下
|
使用#include ,得到的是置于名字空间std下的iostream库的元素,需要引入命名空间,即"using namespace std;";如果使用#include ,得到的是置于全局空间的同样的元素。
在全局空间获取元素会导致名字冲突,而设计名字空间的初衷正是用来避免这种名字冲突的发生。
在全局空间获取元素会导致名字冲突,而设计名字空间的初衷正是用来避免这种名字冲突的发生。
|
是不是用了#include 这样的文件, 试试改为
#include
using namespace std;
#include
using namespace std;
|
使用GCC选项-Who-deprecated就不会再有这个警告了