First, we need the MinGW compiler package. Head on to http://sourceforge.net/projects/mingw/files/ to get the latest version.
|You may see another version, of course newer than the one in the above image.|
You may proceed with the installation. Few steps ahead, you will be asked which compilers you want downloaded and installed. Check C, C++ and MSYS Basic System.
Continue the installation.
The installer will download and install the newest MinGW and MSYS components.
After it's finished, open Computer, right click on some empty spot, and press Properties. Or, open Computer, and click System properties in the menu-bar.
Now, double click it, and put your cursor at the end of the Value textbox.
Add semicolon right after the last character (only if it isn't another semicolon, in which case you just paste the directory) and paste the location of the MinGW bin directory (Usually C:\MinGW\bin). Now add another semicolon after the MinGW bin directory, and paste the MSYS bin directory (Usually C:\MinGW\msys\1.0\bin).
Press OK on both dialogs, and open NetBeans.
Go to Tools-> Options-> C/C++, and press the Add button which is found below the Tool Collection panel.
For the Base Directory select the MinGW bin folder, and press OK.
After this step, NetBeans should recognize and select automatically all the needed compilers, except the "make" command. If you select the mingw32-make.exe file, it will be refused.
Press OK to close this dialog, and restart NetBeans. Your adding of C++ compiler to NetBeans 7.x is completed.
If you have any problems with the setup, feel free to post it here.