title: How do I solve the following errors: "Undefined reference to WinMain", "[Error] Id returned 1 exit status"?
body: <p>I'm writing a C program and using Dev C++ to compile/run it.</p>
  
  <p>However, it's coming up with the error:</p>
  
  <pre class="lang-none prettyprint-override"><code>undefined reference to 'WinMain'" and "[Error] Id returned 1 exit status"
  </code></pre>
  
  <p>What do these errors mean, and how do I solve them?</p>
  
  <p>The <code>WinMain</code> error appears to be linked to line 18 of my code which is...</p>
  
  <pre><code>int read_char() { return getchar(); }
  </code></pre>
  
  <p>Any ideas? I'm a beginner with C, and I haven't found an answer to this question that I understand.</p>
  
  <p>I presume it's because I'm using Windows. Would the code work on linux as it is perhaps?</p>