title: LNK2005 happen when include .h file in .c file
body: <p>I am trying to implement a Stack in a program using C language. I separate them into 3 file. </p>
  
  <p>First, stack.h file. It include some essential declaration and function such as Pop, Push for a stack. 
  Second, stack.c file. It is a file implement the function inside stack.h file. In my case, I implement my stack using a dynamic array.
  Third, main.c file. It is where I use Stack to do some calculation.</p>
  
  <p>However, I get LNK2005(...already defined in ...obj) compile error at the end. I know this error would happen when there exist a multiple times of definition. However, I saw many example with same function name in .h/.c file but didn't cause a error.</p>
  
  <p>Here is the error log:</p>
  
  <pre><code>LNK1169 one or more multiply defined symbols found
  LNK2005 _CreateStack already defined in main.obj
  LNK2005 _IsEmpty already defined in main.obj
  LNK2005 _Pop already defined in main.obj
  LNK2005 _Push already defined in main.obj
  LNK2005 _StackDepth already defined in main.obj
  </code></pre>
  
  <p>Thanks for you kindly attention.
  Here is my stack.h file.</p>
  
  <pre><code>typedef struct Stack Stack;
  
  Stack* CreateStack();
  void Push(Stack *s, char InputString);
  void Pop(Stack *s);
  int StackDepth(Stack *s);
  int IsEmpty(Stack *s);
  </code></pre>
  
  <p>Here is my stack.c file.</p>
  
  <pre><code>#include "stack.h"
  
  typedef struct Stack{
      .....
      .....
  }
  
  Stack* CreateStack(){
      ......
  };
  
  void Push(Stack *s, char InputString){
      ....
      ....
  }
  
  void Pop(Stack *s){
      ....
  };
  
  int StackDepth(Stack *s){
      ....
  };
  
  int IsEmpty(Stack *s){
      ....
  };
  </code></pre>
  
  <p>Here is my main.c file</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include"stack.c"
  #include"stack.h"
  
  int main(){
      ....
      ....
      ....
      return 0;
  }
  </code></pre>