c++ main file confusion
As making a small project for my college work, i thought to work on c++.

My project has many *.h and corresponding *.cpp files.

Then i created a main file that has the main function.
I included all the header files that i required in main.
but it showed 
  [Linker error] undefined reference to `Class_Name::Class_Constructor()'
and also for other functions.

Then i replaced header files with source cpp files and it worked.
Now i thought that it should be other way round. and 
<b> cannot explain why it is happening. </b> since we generally include header files only and that works.
May be generally we require only declarations and now we require definitions in main.
Am i right ?
c++ main file confusion
===

As making a small project for my college work, i thought to work on c++.

My project has many *.h and corresponding *.cpp files.

Then i created a main file that has the main function.
I included all the header files that i required in main.
but it showed 
  [Linker error] undefined reference to `Class_Name::Class_Constructor()'
and also for other functions.

Then i replaced header files with source cpp files and it worked.
Now i thought that it should be other way round. and 
<b> cannot explain why it is happening. </b> since we generally include header files only and that works.
May be generally we require only declarations and now we require definitions in main.
Am i right ?