(No #includes or 'using' of any kind allowed)
So I have a dlist.h and dlist.cpp... My first line of code is
(I have 160ish lines all together)
1 2 3 4 5 6 7 8 9 10 11 12
|
//Makes an empty list
template <typename T>
Dlist<T>::Dlist() : first(NULL), last(NULL)
{
}
template <typename T>
Dlist<T>::~Dlist()
{
makeEmpty();
}
|
Upon compile:
.cpp(4) error 2143: syntax error : missing ';' before '<'
.cpp(4) error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
.cpp(4): error C2988: unrecognizable template declaration/definition
.cpp(4): error C2059: syntax error : '<'
Errors like these continue throughout my code...
Anyone have a suggestion as to how to start fixing these?
I am compiling the dlist.cpp, dlist.h, altnew.h, altnew.cpp, and my testl.cpp, which tests the list. The errors continue until
dlist.cpp(9): error C2588: '::~Dlist' : illegal global destructor
dlist.cpp(9): fatal error C1903: unable to recover from previous error(s); stopping compilation
-----
The end goal of my project is to write the dlist.cpp then use it to drive a calculator and call center.