主题:error LNK2001 错误
本人乃一C语言新手,在做练习题时发现一问题。编译无错可是组建的时候出错:
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Cpp6.exe : fatal error LNK1120: 1 unresolved externals
望大家援手。不胜感激!!
#include <iostream.h>
void mian()
{
char grade;
cin>>grade;
if (grade>='a'&&grade<='z')
grade -=32;
switch (grade)
{
case 'A':
case 'B':
case 'C':
cout<<"pass\n";
break;
case 'D':
cout<<"fail\n";
break;
default:
cout<<"error\n";
}
}
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Cpp6.exe : fatal error LNK1120: 1 unresolved externals
望大家援手。不胜感激!!
#include <iostream.h>
void mian()
{
char grade;
cin>>grade;
if (grade>='a'&&grade<='z')
grade -=32;
switch (grade)
{
case 'A':
case 'B':
case 'C':
cout<<"pass\n";
break;
case 'D':
cout<<"fail\n";
break;
default:
cout<<"error\n";
}
}