title: Why getting multiple definition error in C code?
body: <p>i'm currently doing a simulation of adt in c, and i'm supposed to make a binary search tree invloving strings, i'm currently starting coding but i get this error and it doesnt say where the error comes from, here's the code, can somebody help me.</p>
  <p>tree.h</p>
  <pre><code>#ifndef tree_h
  #define tree_h
  #include &lt;stdbool.h&gt;
  #include &lt;stdlib.h&gt;
  
  typedef struct tree_node* node_ptr;
  
  struct tree_node {
      char* word;
      node_ptr leftNode, rightNode;
  };
  
  node_ptr start = NULL;
  
  void addItem(char*, int);
  void display();
  
  #endif
  </code></pre>
  <p>tree.c</p>
  <pre><code>#include &quot;tree.h&quot;
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;stdbool.h&gt;
  
  
  void addItem(char arr[], int mode) {
      node_ptr temp, temp2;
       
      temp = (node_ptr)malloc(sizeof(struct tree_node));
      temp-&gt;leftNode=NULL;
      temp-&gt;rightNode=NULL;
      
      if(mode == 1){
          temp-&gt;word = arr;
          start = temp;
          }
      }  
  
  
  
  void display() {
      node_ptr temp;
      temp = start;
      printf(&quot;%s&quot;, start-&gt;word);       
  }
  </code></pre>
  <p>main.c</p>
  <pre><code>#include &quot;tree.h&quot;
  #include &lt;stdio.h&gt;
  #include &lt;conio.h&gt;
  
  int main() {
      char word[31];
      
      printf(&quot;Enter Root Word: &quot;);
      gets(word);
      addItem(word, 1);
  }
  </code></pre>