极光世界散人心法加点:vc错误提示的问题

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/28 11:43:47
我编写了如下程序:
#include <iostream.h>
void main()
{
int sco,grade;
cout<<"please input a student's scode.";
cin>>sco;
grade=sco/10;
switch(grade)
{
case 10: cout<<"Are you a cheater?";break;
case 9:cout<<"Extraordinary,body!";break;
case 8:cout<<"Good work,body!";break;
case 7:cout<<"Keep going,My dear!";break;
case 6:cout<<"Just pass.";break;
case 5:cout<<"You can't pass!";break;
case 4:cout<<"You can't pass!";break;
case 3:cout<<"You can't pass!";break;
case 2:cout<<"You can't pass!";break;
case 1:cout<<"You can't pass!";break;
case 0:cout<<"You can't pass!";break;
default:cout<<"The wrong input number!\n";break;
}
}
compile一下没有问题,但是build的时候出现如下错误提示,请问是怎么回事?另外我有好多程序都这样,是我写错了还是vc程序没有装好?

--------------------Configuration: test07121428 - Win32 Debug--------------------
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/test07121428.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

test07121428.exe - 2 error(s), 0 warning(s)
_ight_我还是没有找到你说的哪个控制台,解决方案窗口是哪个呢?
tanyuguo_我就是新建的c++ source file,但是结果你也看到了.

无法连接到函数 _WinMain,由于不是控制台程序所以不能用 main()
你去设置项目属性,设置项目的类型为 控制台

随便新建一个C++ source file,把这段代码贴进去就行了