I have been battling with this project since from Monday. I do not know why I get these 5 errors

I am getting this error when compiling my program:

Compiling C:\Dev-Cpp\Chapter5\Today\LlistType\main.cpp...

[Error] C:\Dev-Cpp\Chapter5\Today\LlistType\orderedLinkedListType.h:13: error: expected template-name before '<' token
[Error] C:\Dev-Cpp\Chapter5\Today\LlistType\orderedLinkedListType.h:13: error: expected `{' before '<' token
[Error] C:\Dev-Cpp\Chapter5\Today\LlistType\orderedLinkedListType.h:13: error: expected unqualified-id before '<' token
[Warning] C:\Dev-Cpp\Chapter5\Today\LlistType\orderedLinkedListType.h:21:7: warning: no newline at end of file
[Error] C:\Dev-Cpp\Chapter5\Today\LlistType\main.cpp:8: error: aggregate `orderedLinkedListType<int> list1' has incomplete type and cannot be defined
[Error] C:\Dev-Cpp\Chapter5\Today\LlistType\main.cpp:8: error: aggregate `orderedLinkedListType<int> list2' has incomplete type and cannot be defined

Complete Compile C:\Dev-Cpp\Chapter5\Today\LlistType\main.cpp: 5 error(s), 3 warning(s)

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

Compiling C:\Dev-Cpp\Chapter5\Today\LlistType\main.cpp...
[Warning] C:\Dev-Cpp\Chapter5\Today\LlistType\linkedList.h:103:7: warning: no newline at end of file
[Error] C:\Dev-Cpp\Chapter5\Today\LlistType\orderedLinkedListType.h:13: error: expected template-name before '<' token
[Error] C:\Dev-Cpp\Chapter5\Today\LlistType\orderedLinkedListType.h:13: error: expected `{' before '<' token
[Error] C:\Dev-Cpp\Chapter5\Today\LlistType\orderedLinkedListType.h:13: error: expected unqualified-id before '<' token
[Warning] C:\Dev-Cpp\Chapter5\Today\LlistType\orderedLinkedListType.h:21:7: warning: no newline at end of file
[Error] C:\Dev-Cpp\Chapter5\Today\LlistType\main.cpp:8: error: aggregate `orderedLinkedListType<int> list1' has incomplete type and cannot be defined
[Error] C:\Dev-Cpp\Chapter5\Today\LlistType\main.cpp:8: error: aggregate `orderedLinkedListType<int> list2' has incomplete type and cannot be defined
[Warning] C:\Dev-Cpp\Chapter5\Today\LlistType\main.cpp:39:2: warning: no newline at end of file

Complete Compile C:\Dev-Cpp\Chapter5\Today\LlistType\main.cpp: 5 error(s), 3 warning(s)
[code]
//Ordered linked list derived from general linked list
//Header File: orderedLinkedList.h

#ifndef ORDEREDLINKEDLISTTYPE_H
#define ORDEREDLINKEDLISTTYPE_H

#include<iostream>
#include<cassert>
#include "linkedList.h"

using namespace std;
template<class Type>
class orderedLinkedListType : public linkedListType<Type>
{
public: 
	bool search(const Type& searchItem);
	void insertNode(const Type& newItem);
	void deleteNode(const Type& deleteItem);
	protected:
};
#endif

The main program:
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
#include<iostream>
#include "orderedLinkedListType.h"

using namespace std;

int main()
{
	orderedLinkedListType<int> list1, list2;
	int num;
	
	cout<< "Enter integers ending with -999"<<endl;
	cin >>num;
	
	while(num != -999)
	{
		list1.insertNode(num);
		cin >> num;
	}
	
	cout <<endl;
	
	cout<<" List 1: " << list1 << endl;
	
	list2 = list1 ;   //test the assignment operator
	
	cout << "List 2: " << list2 << endl;
	
	cout <<" Enter the number to be "
		 <<"deleted: ";
	cin >> num;
	cout << endl;
	
	list2.deleteNode(num);
	
	cout<<" After deleting the node, "
		<<"List 2: " << endl << list2 << endl;
	
	return 0;
}
What's in linkedList.h?

Using using namespace std; in a header file?
here it is
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#ifndef LINKEDLIST_H
#define LINKEDLIST_H
#include<iostream>
using namespace std;
struct nodeType
{
	int info;
	nodeType *link;	
};
class linkedList
{
		private:
		nodeType *first, *last;
		public:
		linkedList()
		{
			first = NULL;
			last = NULL;
		}
		void newNode(int value)
		{
			nodeType *temp = new nodeType;
			temp->info = value;
			temp->link = NULL;
			if(first == NULL)
			{
				first = temp;
				last = temp;
				temp = NULL;
			}
			else
			{	
				last->link = temp;
				last = temp;
			}
		}
		void display()
		{
			nodeType *temp = new nodeType;
			temp = first;
			while(temp != NULL)
			{
				cout<<temp->info<<"\t";
				temp = temp->link;
			}
		}
		void insertFirst(int value)
		{
			nodeType *temp = new nodeType;
			temp->info = value;
			temp->link = first;
			first = temp;
		}
		void insertAt(int pos, int value)
		{
			nodeType *trailCurrent = new nodeType;
			nodeType *current = new nodeType;
			nodeType *temp = new nodeType;
			current = first;
			for(int i = 1; i < pos; i++)
			{
				trailCurrent = current;
				current = current->link;
			}
			temp->info = value;
			trailCurrent->link = temp;	
			temp->link = current;
		}
		void deleteFirst()
		{
			nodeType *temp = new nodeType;
			temp = first;
			first = first->link;
			delete temp;
		}
		void deleteLast()
		{
			nodeType *current = new nodeType;
			nodeType *trailCurrent = new nodeType;
			current = first;
			while(current->link != NULL)
			{
				trailCurrent = current;
				current = current->link;	
			}
			last = trailCurrent;
			trailCurrent->link = NULL;
			delete current;
		}
		void deleteAt(int pos)
		{
			nodeType *current = new nodeType;
			nodeType *trailCurrent = new nodeType;
			current = first;
			for(int i = 1; i < pos; i++)
			{
				trailCurrent = current;
				current = current->link;
			}
			trailCurrent->link = current->link;
		}
};
#endif 
Topic archived. No new replies allowed.