title: makefile and multiple file C++ template issue
body: <p>I've got a C++ template class split into two files using #include directive as suggested in this link --&gt; <a href="https://stackoverflow.com/questions/36039/templates-spread-across-multiple-files">Templates spread across multiple files</a></p>
  <p>For both files I've used the standard naming *.h and *.cpp.
  In the makefile I've included the *.h one since - as I understand it - both files split in such way are in fact one from the compiler point of view. I've set the same compilation options as in case of compiling a ususal *.cpp file.</p>
  <p>However, when I try to compile it through makefile i get the following error:</p>
  <pre><code>Stos.o: file not recognized: File format not recognized
  collect2: ld returned 1 exit status
  make: *** [program] Error 1
  </code></pre>
  <p>I've read somewhere that it might be due to the fact that I compile *.h file. I do not know what should I do instead.</p>
  <p>Thank you for your help.</p>
  <h3>EDIT</h3>
  <p>I am posting the makefile itself to make matter more clear. Please, excuse me that the names are not in English, however in this case this shouldn't be a problem. I've updated the error message so that it fits the makefile.</p>
  <p>Because of suggestions here, I've already changed names for template files from *.h and *.cpp mentioned above to *.hpp and *.tpp.</p>
  <pre><code>CC=g++
  CFLAGS=-c -Wall -pedantic -W
  COMP= $(CC) $(CFLAGS)
  
  program: Graf.o wgraf.o wnazwe.o menu.o Stos.o TabDyn.o komunikaty.o main.o
      $(CC) Graf.o wgraf.o wnazwe.o menu.o Stos.o TabDyn.o komunikaty.o main.o -o program
  Graf.o: graf_struktura/Graf.cpp graf_struktura/Graf.h lifo/TabDyn.hpp lifo/Stos.hpp
      $(COMP) graf_struktura/Graf.cpp -o $@
  wgraf.o: wczytywanie_grafu/wczytaj_graf.cpp wczytywanie_grafu/wczytaj_graf.h    graf_struktura/Graf.h lifo/Stos.hpp
      $(COMP) wczytywanie_grafu/wczytaj_graf.cpp -o $@
  wnazwe.o: wczytywanie_grafu/wczytaj_nazwe_pliku.cpp    wczytywanie_grafu/wczytaj_nazwe_pliku.h wczytywanie_grafu/komunikaty.cpp 
      $(COMP) wczytywanie_grafu/wczytaj_nazwe_pliku.cpp -o $@
  komunikaty.o: wczytywanie_grafu/komunikaty.cpp
      $(COMP) wczytywanie_grafu/komunikaty.cpp
  menu.o: menu/menu.cpp graf_struktura/Graf.h
      $(COMP) menu/menu.cpp
  main.o: main.cpp wczytywanie_grafu/wczytaj_nazwe_pliku.h    wczytywanie_grafu/wczytaj_graf.h menu/menu.cpp graf_struktura/Graf.h
      $(COMP) main.cpp
  #Here is the issue.
  Stos.o: lifo/Stos.hpp lifo/Stos.tpp lifo/TabDyn.hpp
      $(COMP) lifo/Stos.hpp -o $@
  TabDyn.o: lifo/TabDyn.hpp lifo/TabDyn.tpp
      $(COMP) lifo/TabDyn.hpp -o $@
  </code></pre>
  <p>Compiler actually creates &quot;Stos.o&quot; but fails to include it in &quot;program&quot; producing quoted error.</p>
  <p>Hope that now my issue is more clear. Sorry if makefile is not elegant. I'm still a beginner at makefiles, please be understanding.</p>