Here is a step by step instructions to setup Netbeans for C/C++ development on your PC using Cygwin compiler.
1.First Download Netbeans IDE 7.2
, which is the latest at this time, and be sure to download C/C++/b] Bundle or the All bundle if you would like to develop for [b]Java
too in future or now.
2.After downloading Netbeans
Install the software and then go to this site
and download the installer for the compiler
3.Run the cygwin setup
, click Next
and then select the install directory which is by default C:\cygwin
and select local package directory i.e. where you want to keep the installation files and click Next
and Select your internet connection
and click Next
now you will see some sites (mirror sites) select any of them and click Next
4.Now the software will download a list of developer tools from which you have to select only those which will help you run C/C++
program.After it has downloaded the list you will see something like this:-
5.Here is a list of tools to be downloaded for C/C++ development, you can use the search bar inside the cygwin installer to find those files:-
6.Now, tools are installed now we have to add path to cygwin
in Environment variables
and for that we need to go to Advanced Settings
in the System properties
(Properties of Computer
7.Click on Environment Variables and Find Path
under System variables
and click on Edit.
8.Go to the end of the line and add a semi colon (;) and put the directory to the cygwin library by default it’s C:\cygwin
so you will add it like this :-
C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Cygwin
(this is just an example don’t copy paste this one just put a semi colon and add directory to cygwin at the last)
9.Now, open Netbeans
and on the menu bar
click on Tools –> Options
Click on C/C++
button under Options
and click on add as in the picture.
10.Browse the base directory
directory inside Cygwin
folder like on my PC it’s in C:\cygwin\bin
so i will choose that path and then click on OK
11.Make the new tool Default
and delete the previous one and you are done.
12. now it’s time to check if the compiler works or not.Follow the steps below to check if it works or not.
13.Click on file and then click on New Project
and in the category select C/C++
and in the projects select C/C++ Application
Click on Next
and put a name for your program and Finish
14.Expand your Program Tree
and then inside the Main program tree
you will see Source Files
expand it as well and inside it there will be main.c
, double click it and delete everything inside it.
15.Now write this small basic program to check if the compiler works or not:-
If everything works alright you will see this:-
I had To Delete Some Images from This Post, You Can Visit The Link Below If You Want To See The Post with Images:-
Configuring NetBeans For C/C++