title: error LNK2019: unresolved external symbol main referenced in function __tmainCRTStartup MSVCRTD.lib(crtexe.obj)
body: <p>I keep receiving the following two errors and I can't figure out why.</p>
  
  <pre><code>error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup MSVCRTD.lib(crtexe.obj)
  
  error LNK1120: 1 unresolved externals
  </code></pre>
  
  <p>Ensuring that I run it as Console [even in Linker Properties it says Console]
  I am using VC++ 2012 Ultimate.  I'm not insanely technically oriented with jargon and advanced concepts so please try not to overwhelm me Dx.</p>
  
  <pre><code>//Main.cpp
  #include &lt;conio.h&gt;
  #include "XArray.h"
  
  
  int Main() {
      XArray&lt;int&gt; Test;
      Test.Add(3);
      getch();
      return 1;
  }
  </code></pre>
  
  <p>Followed by.</p>
  
  <pre><code>#ifndef XARRAY_H
  #define XARRAY_H
  
  template &lt;class X&gt;
  class XIndex {
  public:
      X Value;
      XIndex&lt;X&gt; *Next;
  
      //Construct
      XIndex(X ArrayValue) { Value = ArrayValue; Next = nullptr; }
  
  };
  
  template &lt;class X&gt;
  class XArray {
      XIndex&lt;X&gt; *First;
  public:
      //Construct/Destruct;
      XArray() { First = nullptr; }
      ~XArray();
  
      //Operators that Alter the structure;
      void Add(X); //Add X to the end.
      void AddX(X, int); //Create Int amount of X values
      void Insert(int, X); //Insert X at Index int
      bool Remove(int); //Remove Index int. Return true if deleted, false if failed.
      //void Sort(); //Todo -- Sorts by value.
      //Operators that deal with the values.
      X Get(int);
      void Set(int, X);
  
  
  };
  
  template &lt;class X&gt;
  void XArray&lt;X&gt;::AddX(X NewVal, int Quantity) {
      for (int i = 0; i &lt; Quantity; i++)
          Add(NewVal);
  }
  
  template &lt;class X&gt;
  void XArray&lt;X&gt;::Add(X NewVal) {
      XIndex&lt;X&gt; *CurrentIndex;
      XIndex&lt;X&gt; *NewNode; //Where we store NewVal
      NewNode = new XIndex&lt;X&gt;(NewVal);
  
      //List doesn't exist.
      if (!First) { 
          First = NewNode;
      } else {
          //Start at beginning.
          CurrentIndex = First;
          while ((*CurrentIndex).Next){ 
              CurrentIndex = (*CurrentIndex).Next;
          }
          (*CurrentIndex).Next = NewNode;
      }
  
  }
  
  template &lt;class X&gt;
  void XArray&lt;X&gt;::Insert(int Index, X NewVal) {
      XIndex&lt;X&gt; *CurrentIndex;
      XIndex&lt;X&gt; *PrevIndex;
      XIndex&lt;X&gt; *NewNode; //Where we store NewVal
      iCounter = 0;
      NewNode = new XIndex&lt;X&gt;(NewVal);
  
      //List doesn't exist.
      if (!First) { 
          First = NewNode;
      } else {
          //Start at beginning.
          CurrentIndex = First;
  
          while ((*CurrentIndex).Next != nullptr &amp;&amp; iCounter &lt; Index){ 
              iCounter += 1
              PrevIndex = CurrentIndex;
              CurrentIndex = (*CurrentIndex).Next;
          }
          if (PreviousNode == nullptr) {
              First = NewNode;
              (*NewNode).Next = CurrentIndex;
          } else {
              (*PrevIndex).Next = NewNode;
              (*NewNode).Next = CurrentIndex;
          }
      }
  
  }
  
  template &lt;class X&gt;
  bool XArray&lt;X&gt;::Remove(int Index) {
      XIndex&lt;X&gt; *CurrentIndex;
      XIndex&lt;X&gt; *PrevIndex;
      int iCounter = 0;
      if (First == nullptr) return false; //We never had a list.
  
      //It's the first one;
      if (Index == 0) {
          CurrentIndex = (*First).Next;
          delete First;
          First = CurrentIndex;
          return true;
      }
  
      //Starting as normal.
      CurrentIndex = First;
  
      //Loop until we reach the index.
      while (CurrentIndex != nullptr &amp;&amp; iCounter &lt; Index) {
          iCounter += 1
          PrevIndex = CurrentIndex;
          CurrentIndex = (*CurrentIndex).Next;
      }
      if (CurrentIndex != nullptr) {
          (*PrevIndex).Next = (*CurrentIndex).Next;
          delete CurrentIndex;
          return true;
      }
      return false;
  
  }
  
  //Destructor;
  template &lt;class X&gt;
  XArray&lt;X&gt;::~XArray() {
      XIndex&lt;X&gt; *NextIndex;
      XIndex&lt;X&gt; *CurrentIndex;
  
      //Start at beginning.
      CurrentIndex = First;
  
      //So long as we aren't at the end [when Next = nullptr];
      while (CurrentIndex != nullptr) {
          NextIndex = (*CurrentIndex).Next;
          delete CurrentIndex;
          CurrentIndex = NextIndex;
      }
  }
  #endif
  </code></pre>