Hi
I have problem in including file in a class. I have a fuction declared in .h file and define in .c file when i am trying to call it in my .cpp file then it gives error

error: undefined reference to `packet_formation(unsigned char, unsigned char)'
while i am including its header file.
But when by mistake i include its .c file then it is running accurately.
What is the problem i am not understanding, can we include .c(source file) , is it not unlogical including a source file while the header file has the declaration of function.

Please help me to understand this.