DevC++ 编译不过? 初学者
刚下了个DevC++ 4.9.8.0 新建了个源代码
在里面写了下面内容然后Ctrl+F9怎么编译不过呢????
#include <iostream.h>
void main()
{
cout << "OK";
}
提示转到了 iostream.h 中的#include "backward_warning.h"
下面是错误提示
#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.
问题点数:20、回复次数:19Top
1 楼liul17(溜溜)回复于 2003-09-04 18:38:06 得分 0
没人知道吗Top
2 楼neubird(带发修行的猪)回复于 2003-09-04 18:51:37 得分 0
意思是说要你最好该用#include <iostream>而不用#include <iostream.h>,<iostream>比<iostream.h>要新。Top
3 楼sakurar(开发者绝不是好玩家)回复于 2003-09-04 19:20:55 得分 1
用include <iostream>Top
4 楼liul17(溜溜)回复于 2003-09-05 08:39:59 得分 0
我改为了 #include <iostream> 但 提示是: 'cout' undeclared (first use this )
Top
5 楼niefuhua(阳光)回复于 2003-09-05 08:44:34 得分 10
还要在#include <iostream>下加一句:
using namespace std;
Top
6 楼limd(好久没来了)回复于 2003-09-05 08:47:54 得分 2
再加一个using namespace std; 试试看Top
7 楼BAYERN(我有个愿望-要把月亮踹成直的,把太阳捏成方的)回复于 2003-09-05 09:19:23 得分 0
怎么可能??
这么简单的程序Top
8 楼liul17(溜溜)回复于 2003-09-05 11:03:33 得分 0
为什么要加 using namespace std; ???? 能解释一下吗?Top
9 楼jiangpeng(Mr. J)回复于 2003-09-05 11:12:40 得分 0
兄弟,看看《C++ PRIMER》吧Top
10 楼Peterwby(wuhen)回复于 2003-09-05 12:03:35 得分 4
#include <iostream>//这是你虽然包含了iostream文件但是cout等是放在std这个名字空间里面的,所以要using namespace std;这句使cout能够被使用Top
11 楼liul17(溜溜)回复于 2003-09-05 12:32:26 得分 0
多谢问题解决
大家能给我提供几本电子图书吗(最好有下载地址)?楼上的《C++ PRIMER》是电子图书吗?哪有下载?Top
12 楼Jinhao(辣子鸡丁·GAME就这样OVER了)回复于 2003-09-05 12:38:11 得分 1
设置路径
或写成
#include <iostream>:
using namespace std;Top
13 楼liul17(溜溜)回复于 2003-09-05 13:18:13 得分 0
如何设置路径呢Top
14 楼liul17(溜溜)回复于 2003-09-05 14:09:00 得分 0
upTop
15 楼liul17(溜溜)回复于 2003-09-05 16:52:01 得分 0
大家帮帮忙Top
16 楼cxjddd(又是花开时)回复于 2003-09-05 17:50:17 得分 0
没什么大不了的。找本“现代”一点的书看看就完了。
你写的太老式了。
#include <iostream>
using namespace std;Top
17 楼Wolf0403(废人:独活十年~心如刀割)回复于 2003-09-05 18:05:09 得分 1
#include <iostream.h>
void main()
{
cout << "OK";
}
新版 C++ 写法:
#include <iostream>
using namespace std;
int main()
{
cout << "OK";
return 0;
}
或者
#include <iostream>
int main()
{
std::cout << "OK";
return 0;
}
为了能看到结果,应该在 return 0 前面加上
system("PAUSE");Top
18 楼liul17(溜溜)回复于 2003-09-08 10:04:46 得分 0
upTop
19 楼robertnet(大师兄)回复于 2003-09-08 10:56:20 得分 1
#include <iostream>
using namespace std;
int main()
{
cout << "OK";
system("PAUSE");
return 0;
}
如此即可。
Top




