Nov
19

How can i use GCC in windows/cmd just like using gcc in linux terminal?

At work i use gcc in linux but at home i use windows so i need to figure out the way of using gcc in cmd of windows just like using gcc in linux terminal. Since i dont like to use IDE such eclipse and neatbeans.

i came to know three option

1> Use Cygwin package

2> Use MinGW

3> Use MSYS

 

Well among all of them i have chosen option of using Cygwin package because
 

  • Cygwin is a collection of tools which provide a Linux look and feel environment for Windows.
  • a DLL (cygwin1.dll) which acts as a Linux API layer providing substantial Linux API functionality.

Steps to install and configure cygwin :

  1. Download the Cygwin setup.exe program by  clicking this direct setup.exe link.
  2. Run the setup.exe program. Accept the defaults until you reach the Select Your Internet Connection page. Select the option on this page that is best for you. Click Next.
  3. On the Choose Download Site page, choose a download site you think might be relatively close to you. Click Next.
  4. On the Select Packages page you select the packages to download. Click the + next to Devel to expand the development tools category. You may want to resize the window so you can see more of it at one time.
  5. Select each package you want to download by clicking the Skip label next to it, which reveals the version number of the package to download. At a minimum, select
    • gcc-core: C compiler
    • gcc-g++: C++ compiler
    • gdb: The GNU Debugger
    • make: the GNU version of the ‘make’ utility

    Packages that are required by the packages you select are automatically selected as well.

  6. Click Next to connect to the download site and download the packages you selected, and click Finish when the installation is complete.

Now cygwin with gcc is installed on your windows system now to use gcc you can do following thing

7(a)> in your c drive you will find a cygwin folder inside that you will find Cygwin.bat file whenever you want to use gcc click on this bat file and use it

If you dont like to use this method then follow this method

7(b).  Add the Cygwin compiler directory to your Environment path

  1. Open the Control Panel:
    - On Windows XP select Start > Settings > Control Panel) and double-click System.
    - On Windows 7, type var in the Start menu’s search box to quickly find a link to Edit the system environment variables.
  2. Select the Advanced tab and click Environment Variables.
  3. In the System Variables panel of the Environment Variables dialog, select the Path variable and click Edit.
  4. Add the path to the cygwin-directory\bin directory to the Path variable
  5. save this all setting

Now open cmd and write “bash” and use your gcc…!!

 

JIGAR PATEL

hey I am an Artist who love to write code…! Well I am an EC graduate From Ganpat University and now i am working as Embedded software engineer in one private firm.. find me at here JigAr Patel

More PostsWebsiteTwitterFacebook

You may like to read this also....

Post comment

*

CommentLuv badge
Follow us on Twitter! Follow us on Twitter!

Search in this website

our sponsors

latest comments

Find us on Facebook

Top Authors

35 posts
saurabh
22 posts
10 posts

Find us on stackoverflow

Polls

Tell us who you are

View Results

Loading ... Loading ...

My Bookmarks

Sponsers Link