title: How can I use gcc by installing Cygwin on a Windows machine?
body: <p>i have installed the <code>cygwin</code> package for my netbeans IDE. I can use that in netBeans project. But now I want to use the gcc compiler from a cmd prompt. How can I do that?</p>
  
  <p>In Linux we open a terminal and type </p>
  
  <pre><code>gcc filename.c 
  </code></pre>
  
  <p>and it compiles. Now I want to do the same thing in Windows with Cygwin's gcc.   Can I type <code>gcc filename.c</code> in cmd and it compiles? If so, how?</p>
  
  <p><strong>Edit :</strong></p>
  
  <p>by writing in cmd </p>
  
  <pre><code>gcc --version
  </code></pre>
  
  <p>I get <code>Access is denied</code></p>
  
  <p><strong>Edit 1:</strong> 
  In the C: drive I have a folder named <code>Cygwin</code> that contains <code>Cygwin.bat</code>.</p>
  
  <p>When I run that, a new prompt is opened and inside that when I type <code>gcc filename.c</code>, it works.</p>
  
  <p>In that <code>.bat</code> file  :</p>
  
  <pre><code>@echo off
  
  C:
  chdir C:\cygwin\bin
  
  bash --login -i
  </code></pre>
  
  <p>I don't understand what that means.</p>