我以前用的RH 9也出现这样的情况,只能是编译C程序,不能编译C++
出现如下错误,请各位高手帮忙解决啊
错误如下:
In file included from /usr/include/g++/backward/iostream.h:31,
from a.C:1:
/usr/include/g++/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using oneof 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.C:3: error: `main' must return `int'
这是我在redhat el as 4下编译的,
写一个入门的c++程序,hello.cpp
#include<iostream>
using namespace std;
int main ()
{
cout<<"hello,linux"<<endl;
}
g++ -s -o hello hello.cpp
./hello
看看行不?好像是这样吧?我现在在win下,没办法试验.