title: Fatal error LNK1169: one or more multiply defined symbols found
body: <p>I am getting this error:</p>
  
  <pre><code>fatal error LNK1169: one or more multiply defined symbols found
  </code></pre>
  
  <p>Below are two files containing the code. In file 1, I have the <code>main()</code> function and I am calling the functions which are written in the second file named <code>linklist.cpp</code>.
  Thanks for helping in advance.</p>
  
  <p>File 1 - main.cpp</p>
  
  <pre><code>#include "stdafx.h"
  # include "linklist.cpp"
  
  
  int main(int argc, _TCHAR* argv[])
  {
      node *link_list2;
      link_list2 = createList(31);
      addFront(link_list2,33);
      printList(link_list2);
      printf("Hello There Omer Obaid khan\n");
      return 0;
  }
  </code></pre>
  
  <p>File 2 - linklist.cpp</p>
  
  <pre><code># include "stdafx.h"
  # include &lt;stdlib.h&gt;
  struct node{
      node * next;
      int nodeValue;
  
  };
  
  node* initNode(int number);
  node* createList (int value);
  void addFront (node *head, int num );
  void deleteFront(node*num);
  void destroyList(node *list);
  int getValue(node *list);
  
  node*createList (int value)  /*Creates a Linked-List*/
  {
      node *dummy_node = (node*) malloc(sizeof (node));
      dummy_node-&gt;next=NULL;
      dummy_node-&gt;nodeValue = value;
      return dummy_node;
  }
  
  
  void addFront (node *head, int num ) /*Adds node to the front of Linked-List*/
  {
      node*newNode = initNode(num);   
      newNode-&gt;next = NULL;
      head-&gt;next=newNode;
      newNode-&gt;nodeValue=num;
  }
  
  void deleteFront(node*num)   /*Deletes the value of the node from the front*/
  {
      node*temp1=num-&gt;next;
  
      if (temp1== NULL) 
      {
          printf("List is EMPTY!!!!");
      }
      else
      {
          num-&gt;next=temp1-&gt;next;
          free(temp1);
      }
  
  }
  
  void destroyList(node *list)    /*Frees the linked list*/
  {
      node*temp;
      while (list-&gt;next!= NULL) 
      {
          temp=list;
          list=temp-&gt;next;
          free(temp);
      }
      free(list);
  }
  
  int getValue(node *list)    /*Returns the value of the list*/
  {
      return((list-&gt;next)-&gt;nodeValue);
  }
  
  
  void printList(node *list)   /*Prints the Linked-List*/
  {
  
      node*currentPosition;
      for (currentPosition=list-&gt;next; currentPosition-&gt;next!=NULL; currentPosition=currentPosition-&gt;next)  
      {
          printf("%d \n",currentPosition-&gt;nodeValue);
      }   
      printf("%d \n",currentPosition-&gt;nodeValue);
  
  }
  
  node*initNode(int number) /*Creates a node*/
  {
      node*newNode=(node*) malloc(sizeof (node));
      newNode-&gt;nodeValue=number;
      newNode-&gt;next=NULL;
      return(newNode);
  }
  </code></pre>