error LNK2019: unresolved external symbol

please help me ,a Link problem happened to me ,and it takes me as long as twe night without result !!! pls```````

Main function
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
 #include"utility.h"
//#include"C:\Users\Andy\Documents\Visual Studio 2010\Projects\stack\stack\utility.cpp"
#include"queue.h"
#include <cctype>
void help(){
	cout<<"This progrom is to test the class queue "
		<<"and you can choose this any opreations supported after reading this users's guide"<<endl;
	cout<<"[A]ppend is to append the element input the queue "<<" S[erve] is to remove one element"<<endl;

}

template<typename T>
int  do_command(char command, Queue<T>& queue){
	command=toupper(command);
	switch (command){
	T term;
	case 'A':
		cout<<"please input a elment"<<endl;
		cin>>term;
		queue.append(term);
		break;
	case'S':
	   queue.service();
	   break;
	case'Q':
	 return 0;
}
	return 0;

}


char  get_command(){
	char c;
	cout<<"please input the command "<<endl;
	cin>>c;
	while(1)
	{
	 if(c=='A'||c=='a'||c=='S'||c=='s'||c=='Q'||c=='q')
		  ;  //  do nothing
	 else 
		 {
	 cout<<"wrong command ,pls read turn to help for instructions,and input again"<<endl;
	 cin>>c;}
	 return c;
	
}



}


int main(){
	/*
	*pre:user choose one opreation supported by linked queue 
	*post:this program do that opreation accordingly ,and quit if user don't want to test any more
	*user:class linked queue ,and its methods ,created by Andy ,12/7/2010;
	*
	*/
 help(); 
 Queue<double>  my_queue;
 while(user_says_yes())
  {
  do_command(get_command(),my_queue);
   } 
}




queue class

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef QUEUE_H
#define QUEUE_H

#include"C:\Users\Andy\Documents\Visual Studio 2010\Projects\stack\stack\utility.h"
#include"node.h"
const int Null=0;
template<typename T>
class Queue{
public:
 Queue(){front=Null;
         tail=Null;};
 //Error_code serve( T& entry);
 //Error_code top(T& entry) const;
// Error_code remove(const int* pos);
 Error_code service();
 Error_code append(const T& entry);
 //int size() const ;
 //bool empty() const;
private: 
 Node<T> * front,*tail;

};

#endif  




queue.cpp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include"queue.h"
#include"utility.h"
//#include <new>


template<typename T>
Error_code Queue<T>:: service()
	{
	
    if(front==Null)  return fail;
	 else{
		  Node * p=top;
		  top=top->next;
		  delete p;
		  return success;}
}



 


/*this method append one element into the queue,return fail if memory is not enough to New 
 pre:None
 post:append  one element into the queue if there enough memory to New ,else return Error_code 
 */
template<typename T>
Error_code  Queue<T>:: append(const T& entry){


    Node<T> *new_rear = new Node(item);
   if (new_rear == NULL) return overflow;
   if (rear == NULL) front = rear = new_rear;
   else {
      rear->next = new_rear;
      rear = new_rear;
   }
   return success;


}




the code it's a little big long ,I didn't post it all .
Topic archived. No new replies allowed.