Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6797493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:36:57+00:00 2026-05-26T18:36:57+00:00

i have installed the cygwin package for my netbeans IDE. I can use that

  • 0

i have installed the cygwin 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?

In Linux we open a terminal and type

gcc filename.c 

and it compiles. Now I want to do the same thing in Windows with Cygwin’s gcc. Can I type gcc filename.c in cmd and it compiles? If so, how?

Edit :

by writing in cmd

gcc --version

I get Access is denied

Edit 1:
In the C: drive I have a folder named Cygwin that contains Cygwin.bat.

When I run that, a new prompt is opened and inside that when I type gcc filename.c, it works.

In that .bat file :

@echo off

C:
chdir C:\cygwin\bin

bash --login -i

I don’t understand what that means.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:36:58+00:00Added an answer on May 26, 2026 at 6:36 pm

    I see from your latest comment that it works when you run gcc from the Cygwin bash shell.

    The Access is denied message was appearing when you tried to run gcc from the Windows cmd prompt. I don’t know why you’d get that particular message.

    My advice is just to use the bash shell. (It also has a lot of nice features that the Windows command shell lacks.) If that’s a good solution for you, feel free to stop reading now.

    But if you really want to use Cygwin tools (such as gcc) from a Windows prompt, you need to update your Windows %PATH% to include the Cygwin bin directory. As seen from bash, the directory is /usr/bin/; from Windows, it’s going to be something like C:\cygwin\bin (assuming you installed Cygwin in C:\cygwin, which is the default).

    To permanently add C:\cygwin\bin to your Windows %PATH%, open System Properties in the Control Panel, tap the “Environment variables” button, and adjust the value of Path in “System variables”. Once you’ve done that, newly opened cmd windows should have the new %PATH% setting. (The user interface for modifying environment variables isn’t exactly use-friendly; maybe somebody else can suggest a better way.)

    EDIT:

    The cygwin.bat batch file changes the current director to C:\cygwin\bin and then launches the Cywgwin bash shell in a new window. That gives you an environment in which gcc works by default, since your $PATH is already set up correctly. The windows command shell and the Cygwin bash shell are quite different environments.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've installed GCC 4.5.0-1 under Cygwin, but now every time I run setup.exe, the
I have Cygwin installed, I want to execute something like this on the command
Most people use gcc on Linux and MSVC compiler on Windows. I have recently
I understand the basic syntax of Objective-C, have installed Cygwin, and want to experiment.
I am pretty sure I have already installed the cygwin default package including the
how to use Linux lib such as timeval in windows I have installed cygwin
I have installed cygwin. But when I try to compile a c++ file it
I have installed VisualStudio Express C# in my box. Now I going to install
On Windows XP I've installed Eclipse CDT. I've installed cygwin including make, gcc, g++,
I'm trying to run genhtml using perl.exe from Cygwin in Windows. I have installed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.