|
源文件是:test.cpp- #include <iostream.h>
- void main()
- {
- double r,girth,area;
- const double PI=3.1415;
- cout<<"Please input radius:\n";
- cin>>r;
- girth=2*PI*r;
- area=PI*r*r;
- cout<<"radius="<<r<<endl;
- cout<<"girth="<<girth<<endl;
- cout<<"area="<<area<<endl;
- }
复制代码
编译命令是:
$ gcc -o test test.cpp
然后就输出了如下的一堆错误!- In file included from /usr/lib/gcc/x86_64-linux-gnu/4.1.2/../../../../include/c++/4.1.2/backward/iostream.h:31,
- from test.cpp:1:
- /usr/lib/gcc/x86_64-linux-gnu/4.1.2/../../../../include/c++/4.1.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 <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
- test.cpp:2: error: ‘::main’ must return ‘int’
复制代码 使用命令:
$ g++ -o test test.cpp
也出现同样的错误!!天啊!!!!!!我怎么这么笨啊!!
在此先感谢了,我知道我的问题可能很愚蠢,但是我不会呀,我也没办法!!唉!!!!!!!!!
很无奈!!!! |
|