title: How to compile executable for Windows with GCC with Linux Subsystem?
body: <p>Windows 10 Anniversary Update includes the Linux Subsystem for Ubuntu. I installed gcc with <code>sudo apt-get install gcc</code>.</p>
  
  <p>I wrote some simple C code for testing purposes:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main(void){
      printf("Hello\n");
      return 0;
  }
  </code></pre>
  
  <p>And compiled it with <code>gcc -c main.c</code> but the execute (Linux only) <code>main.o</code> is generated. If I run it <code>./main.o</code>, it displays <code>Hello</code>.</p>
  
  <p>My question is, how can I compile <code>main.c</code> so that Windows can run it? Basically, how do you generate a <code>*.exe</code> file with GCC in Linux Subsystem ?</p>