Templates can be a problem if not handled correctly. The build process works roughly as follows: the preprocessor modifies the source in accordance with preprocessor definition. The compiler compiles that source, resorting to declarations as a guideline. The compiler does not have to know the contents of external procedures or variables, just how to use them.

The compiler compiles additional sources, as single entities, according to the same guidelines. The linker puts it all together, requring that code exists that conforms to the specification of mere guidelines (declarations) which were enough to satisfy the compiler.

Remember that the compiler is only dealing with one file at a time (as modified or clarified by included files, which are pasted in by the preprocessor).

This means that when there is an attempt to expand upon and produce code for a template, that information must be available immediately. This immediacy is not satisfied by information contained in a compilation that may or may not have been produced at a given point in the build process.

Put yourself in the position of the compiler. If all the required information is not available in the source file, as modified by include files, then you just can't succeed.

Your response sheds some light on how the compilation process works. However i would much appreciate it if you could specifically say where my errors are, and what needs to happen in order to get the templates code working properly. Cheers!

Your main file cannot instantiate the template. It doesn't know how. It isn't going to seach all the files on your system to find out how. Put your template in your main file or in a file that it includes. It doesn't cost anything, because it's a template. No resources are used until it's called upon.

Find out what templates and classes are and think about that. You can't, of course, think about it if you don't know how the build process works. Thus, my original post.