I am working on a class of linked list templates to do the same with various variables, and have managed to deal with most problems. Unless I am compiling, I get the following data:
g++ -Wall -o template_test template_test.cpp In file included from template_test.cpp:1:0: LinkedList.h:50:11: error: declaration of 'class Type' LinkedList.h:7:11: error: shadows template parm 'class Type' LinkedList.h:51:30: error: invalid use of incomplete type 'class LinkedList<Type>' LinkedList.h:8:7: error: declaration of 'class LinkedList<Type>' LinkedList.h:56:11: error: declaration of 'class Type' LinkedList.h:7:11: error: shadows template parm 'class Type' LinkedList.h:57:51: error: invalid use of incomplete type 'class LinkedList<Type>' LinkedList.h:8:7: error: declaration of 'class LinkedList<Type>' LinkedList.h:92:11: error: declaration of 'class Type' LinkedList.h:7:11: error: shadows template parm 'class Type' LinkedList.h:93:31: error: invalid use of incomplete type 'class LinkedList<Type>' LinkedList.h:8:7: error: declaration of 'class LinkedList<Type>' LinkedList.h:102:11: error: declaration of 'class Type' LinkedList.h:7:11: error: shadows template parm 'class Type' LinkedList.h:103:34: error: invalid use of incomplete type 'class LinkedList<Type>' LinkedList.h:8:7: error: declaration of 'class LinkedList<Type>' LinkedList.h:119:11: error: declaration of 'class Type' LinkedList.h:7:11: error: shadows template parm 'class Type' LinkedList.h:120:48: error: invalid use of incomplete type 'class LinkedList<Type>' LinkedList.h:8:7: error: declaration of 'class LinkedList<Type>' LinkedList.h:158:11: error: declaration of 'class Type' LinkedList.h:7:11: error: shadows template parm 'class Type' LinkedList.h:159:37: error: invalid use of incomplete type 'class LinkedList<Type>' LinkedList.h:8:7: error: declaration of 'class LinkedList<Type>' LinkedList.h:193:11: error: declaration of 'class Type' LinkedList.h:7:11: error: shadows template parm 'class Type' LinkedList.h:194:34: error: invalid use of incomplete type 'class LinkedList<Type>' LinkedList.h:8:7: error: declaration of 'class LinkedList<Type>' LinkedList.h:210:11: error: declaration of 'class Type' LinkedList.h:7:11: error: shadows template parm 'class Type' LinkedList.h:211:34: error: invalid use of incomplete type 'class LinkedList<Type>' LinkedList.h:8:7: error: declaration of 'class LinkedList<Type>' make: *** [template_test] Error 1
Pretty much it says the same for every template function that I have. Can someone decrypt for me what these messages mean, what makes the compiler throw these messages, and how can I fix it? I will be re-reading and possibly re-writing my code in the meantime.
My code is as follows:
#include <string>
source share