Hi,
I'm having trouble compiling my program and keep getting a message that my "linker input file unused because linking not done" which I'm assuming is because my Makefile is not correct. I understand the basics behind creating a Makefile with .cc, but am having trouble with including a .t or template file. My program consists of two classes - a main called p.cc and record called record.t (which is a template). The p.cc file calls the record file and creates objects with the template.
You do not need to compile the template/header file separately, the preprocessor includes its contents before p.cc is compiled. In other words, there will be no record.o if it is entirely templates. If it contains more than just templates, you will need to separate record.t1 into a record.cc and record.t2.
1 Actually, even if this did not contain templates and was a source file, GCC expects a limited number of file extensions for C++ source files. man gcc for more information.
2 Template definitions are commonly placed in header files. The header files do not require any special extension conveying that they contain templates, although you could give them one, such as .t, if you prefer. The preprocessor will include any file specified in a #include regardless of its name.
It seems like your flags are a bit wrong. If you use the variables CC, CXX, CXXFLAGS you can use the built in rules in make. If you use standard filenames for your file i will help you as well. Rename record.t to record.cc. Then Make automagic applies the rul