fatal error LNK1120: 二 unresolved externals

fatal error LNK1120: 2 unresolved externals
#include <iostream>
using namespace std;
#include <string>

class  Stud
{
private:
int no;        //学号 
string name;   //姓名 
double deg; //成绩 
static double sum; //总分 
static int  num; //人数

public:
Stud(int no=0,string name="noName",double deg=0.0)
{

    this->no=no;
this->name=name;
this->deg=deg;
this->num+=1;
this->sum+=deg;
}

void setdata(int no,string name,double deg)
{
this->no=no;
this->name=name;
this->deg=deg;
this->sum=(sum-this->deg+deg);
//如果在构造函数中给了成绩,这里又要重新设置,先把原来给的减掉再加上这里新设置的,避免了成绩重复累加 


}
void disp()
{
cout<<this->no<<"\t" <<this->name<<"\t" <<this->deg<<"\t"<<endl;
}
static double avg()
{

double  average=Stud::sum/Stud::num;

return average;

}


};

int main(int argc, char *argv[])
{


Stud student[5];

int no;
string name=NULL;
double deg;
for(int i=0;i<5;i++)

{

cout<<"请输入学号:"<<endl;
cin>>no; 
cout<<"请输入姓名:"<<endl;
cin>>name; 
cout<<"请输入成绩:"<<endl;
cin>>deg; 

student[0].setdata(no,name,deg);




//显示每个同学的成绩 
cout<<"学号"<<"\t" <<"姓名"<<"\t" <<"成绩"<<"\t"<<endl;
for(int j=0;j<5;j++) 
{

student[0].disp();
}


//输出平均成绩 
cout<<endl<<"平均成绩为"<<Stud::avg(); 




return 0;


}




unresolved externals c++  vc6.0

------解决方案--------------------
静态变量需要在类外定义。。

#include <iostream>
using namespace std;
#include <string>

class  Stud
{
private:
int no;         //学号 
string name;    //姓名 
double deg;  //成绩 
static double sum; //总分 
static int  num; //人数
public:
Stud(int no=0,string name="noName",double deg=0.0)
{
this->no=no;
this->name=name;
this->deg=deg;
this->num+=1;
this->sum+=deg;
}

void setdata(int no,string name,double deg)
{
this->no=no;
this->name=name;
this->deg=deg;
this->sum=(sum-this->deg+deg);
//如果在构造函数中给了成绩,这里又要重新设置,先把原来给的减掉再加上这里新设置的,避免了成绩重复累加 
}