title: Using GCC to compile C code
body: <p>I installed MinGW on my <b>Windows</b> 8 laptop and tried to compile a C code file with</p>
  
  <pre><code>gcc test.c -o test.exe
  </code></pre>
  
  <p>the compiler gave no warnings or errors but it did not create test.exe</p>
  
  <p>how do i get the compiler to create the file</p>
  
  <p>test.c</p>
  
  <p><img src="https://i.stack.imgur.com/7C1WR.png" alt="test.c"></p>
  
  <p>My terminal session
  <img src="https://i.stack.imgur.com/cyjm2.png" alt="this is what i tried on terminal"></p>
  
  <p>An interesting observation:</p>
  
  <p>When I deliberately introduce an error in the code and try to compile the compiler shows the error</p>
  
  <p>Code with error
  <img src="https://i.stack.imgur.com/nWfnu.png" alt="enter image description here">
  Compiler output
  <img src="https://i.stack.imgur.com/VjELo.png" alt="enter image description here"></p>
  
  <p>When I try compiling the same code using Command Prompt</p>
  
  <p>This is what it shows
  <img src="https://i.stack.imgur.com/YsSld.png" alt="enter image description here"></p>
  
  <p>But the file does exist in the MinGW\bin directory
  <img src="https://i.stack.imgur.com/R34cs.png" alt="enter image description here"></p>
  
  <p>I moved the</p>
  
  <pre><code>test.c
  </code></pre>
  
  <p>file to</p>
  
  <pre><code>C:\
  </code></pre>
  
  <p>and started the command prompt in the</p>
  
  <pre><code>C:\MinGW\bin
  </code></pre>
  
  <p>directory</p>
  
  <p>and here is what it outputs
  <img src="https://i.stack.imgur.com/EvEWg.png" alt="enter image description here"></p>
  
  <p>Problem partially solved:</p>
  
  <p>I disabled hybrid boot in windows 8 and restarted the computer. The compiler now works in Command Prompt but not in PowerShell.</p>