循环队列类在使用的过程中出现链接有关问题~求指点

循环队列类在使用的过程中出现链接问题~求指点
模板类的.h 如下:
#include "stdafx.h"
#include "Windows.h"
#include "stdlib.h"
#include "iostream.h"
template<class T>
class SqQueue
{
private:
 T *queue;
 int front,rear,MaxSize;
public:
 SqQueue(int sz=30);//构造函数
 SqQueue(SqQueue& sq);//拷贝构造函数
 SqQueue(int arraysz,T *a,int sz=30);//构造函数
 void MakeEmpty();//清空队列
 bool IsEmpty();//队列是否为空
 int GetLength();//获得长度
 int GetMaxSize();//获得队列大小
 T &GetFront();//获得队首元素
 bool EnQueue(T &x);//入队
 bool OutQueue(T &x);//出对
 void show();
 ~SqQueue();//析构函数
};

.cpp文件如下:
template<class T>
SqQueue<T>::SqQueue(int sz)
{
 queue=new T[sz];
 MaxSize=sz;
 front=rear=0;
}

template<class T>
SqQueue<T>::SqQueue(SqQueue& sq)
{
 queue=new T[sq.MaxSize];
 MaxSize=sq.MaxSize;
 front=rear=0;
 for(int i=0;i<sq.GetLength();i++)
 {
  queue[i]=sq.queue[i];
  rear=(rear+1)%MaxSize;
 }
}

template<class T>
SqQueue<T>::SqQueue(int arraysz,T *a,int sz)
{
 if(arraysz>sz)
 {
  cerr<<"The Array is too Large";
  exit(1);
 }
 queue=new T[sz];
 MaxSize=sz;
 front=rear=0;
 for(int i=0;i<arraysz;i++)
 {
  queue[i]=a[i];
  rear=(rear+1)%MaxSize;
 }
}

template<class T>
void SqQueue<T>::MakeEmpty()
{
 front=rear=0;
}

template<class T>
bool SqQueue<T>::IsEmpty()
{
 return front==rear;
}

template<class T>
int SqQueue<T>::GetLength()
{
 return ((rear-front)+MaxSize)%MaxSize;
}

template<class T>
int SqQueue<T>::GetMaxSize()
{
 return MaxSize;
}

template<class T>
T & SqQueue<T>::GetFront()
{
 if(IsEmpty())
 {
  MessageBox(0,"Empty Queue!",0,0);
  exit(1);
 }
 return queue[front];
}

template<class T>
bool SqQueue<T>::EnQueue(T &x)
{
 if((rear+1)%MaxSize==front)
 {
  MessageBox(0,"Queue is Full",0,0);
  return 0;
 }
 queue[rear]=x;
 rear=(rear+1)%MaxSize;
}

template<class T>
bool SqQueue<T>::OutQueue(T &x)
{
 if(rear==front)
 {
  MessageBox(0,"Queue is Empty",0,0);
  return 0;
 }
 x=queue[front];
 front=(front+1)%MaxSize;
}

template<class T>
void SqQueue<T>::show()
{
 while(front!=rear)
 {
  cout<<queue[front]<<" ";
  front=(front+1)%MaxSize;
 }
}

template<class T>
SqQueue<T>::~SqQueue()
{
 delete []queue;
 rear=front;
}


后来我在另一测试文件中的.cpp代码如下:
#include "QueueTemplate.h"
#include <stdio.h>
class Student
{
private:
int age;
int ID;
public:
Student(int a,int b)
{
age=a;
ID=b;
}
int GetAge()
{
return age;
}
int GetID()
{
return ID;
}
};
void main()
{
SqQueue<Student> que;
Student* a=new Student(23,1);
Student* b=new Student(24,2);
que.EnQueue(a);
que.EnQueue(b);
printf("%d",que.GetLength());
}