title: Unresolved external symbol(LNK2019)
body: <p>I am new to C++ . I am trying to develop a C++ application but there is one error that is keep bothering me.</p>
  
  <blockquote>
    <p>Error LNK2019 unresolved external symbol _main referenced in function "int __cdecl invoke_main(void)"</p>
  </blockquote>
  
  <p>I think I have referenced all of my functions in another file</p>
  
  <p><strong>This is the code of my cpp file:</strong></p>
  
  <pre><code>#include "stdafx.h"
  
  
  
  
  int console::main()
  {
      system("cls");
      cout &lt;&lt; "-----------ABC Homestay Management System-----------" &lt;&lt; endl;
      cout &lt;&lt; "------------------------------------------------------------" &lt;&lt; endl;
  
  system("color 0f");
  cout &lt;&lt; "Please enter your choice" &lt;&lt; endl;
  cout &lt;&lt; "1.Upload listings" &lt;&lt; endl;
  cout &lt;&lt; "2.Find listings" &lt;&lt; endl;
  cout &lt;&lt; "3.View listings" &lt;&lt; endl;
  cout &lt;&lt; "4.Exit" &lt;&lt; endl;
  
  int choice;
  cin &gt;&gt; choice;
  
  switch (choice) {
  case 1:
      //renter();
      break;
  case 2:
      //finder();
      break;
  case 3:
      //listings();
      break;
  case 4:
      exit(0);
      break;
  case 8:
      //staff();//secret key -&gt; 8 for staff
      break;
  }
  
      system("pause");
  main();
  return 0;
   }
  
      void console::finder() {
          system("cls");
              cout &lt;&lt; "test" &lt;&lt; endl; 
  
      }
  </code></pre>
  
  <p><strong>This is the "stdafx.h" header file that I have referenced in the cpp file :</strong> </p>
  
  <pre><code>    #pragma once
  
  #include "targetver.h"
  #include &lt;iomanip&gt;
  #include &lt;ctime&gt;
  #include &lt;time.h&gt;
  
  #include &lt;windows.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;tchar.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;tchar.h&gt;
  #include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;sstream&gt;
  #include &lt;string&gt;
  #include &lt;cstdio&gt;
  #include &lt;cstdlib&gt;
  #include &lt;regex&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include&lt;algorithm&gt;
  #include&lt;iterator&gt;
  #include &lt;chrono&gt;
  #include &lt;thread&gt;
  
  using namespace std;
  
  
  
  class console {
  
  public:
      console() {}
      ~console() {}
      int main();
      void renter();
      void finder();
      void listings();
      void staff();
  
  
  
  };
  </code></pre>