Alright, the reason you are here is clear. You are having trouble setting the C++ compiler correctly with NetBeans 7.x on Windows platform. No worries, it's an easy fix.
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. |
Open up the .exe file you just downloaded, and proceed with it's installation. You will encounter a dialog which asks you if you want the pre-packaged repository catalogues, or download the newest ones. It's always better to download the latest catalogue.
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.
Go to Advanced system settings, Environment Variables, in the System Variables list, find the variable Path.
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.
The make.exe file is found in the MSYS bin directory.
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.