title: VS2019 gives me this: unresolved external symbol _main referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ)
body: <p>I have that code. and I created this. but I want to compile it without any console window. and it gives me:</p>
  <pre class="lang-none prettyprint-override"><code>unresolved external symbol _main referenced in function &quot;int __cdecl invoke_main(void)&quot; (?invoke_main@@YAHXZ)&quot;
  </code></pre>
  <p>all subsystems changed to /SUBSYSTEM:WINDOWS*</p>
  <pre><code>long x;
  long y;
  #include &lt;Windows.h&gt;
  
  float hz = rand() % 800;  // input how many hertz you need
  long marcos;
  void drawSomething() {
      marcos = 1000;
      HDC hd = GetDC(NULL);
      BitBlt(hd, 0, 0, 1000, 1000, hd, rand() % 3000 - rand() % 100, rand() % 3000 - rand() % 100, SRCCOPY);
      StretchBlt(hd, 0, 0, rand() % 3000 - rand() % 100, rand() % 3000 - rand() % 100, hd, rand() % 3000 - rand() % 100, rand() % 3000 - rand() % 100, rand() % 3000 - rand() % 100, rand() % 3000 - rand() % 100, SRCCOPY);
  }
  int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hInstPrev, PSTR cmdline, int cmdshow) // oh shit of fu-
  {
      while (true) {
          drawSomething();
      }
      return 0;
  }
  </code></pre>