How to Run C/C++ Program in Netbeans on Windows
This tutorial will take you through the process of running a C/C++ program with the Netbeans IDE (Integrated Development Environment) using screenshots as tools for understanding and clarity. This article is written for use with Windows,...
Part 1 of 5:
Downloading the Components
-
How to Run C/C++ Program in Netbeans on Windows Picture 1
Open each of the following links in separate tabs.- Netbeans
- Compiler and Debugger
-
How to Run C/C++ Program in Netbeans on Windows Picture 2
Download Netbeans- Select the Graphic on the right
How to Run C/C++ Program in Netbeans on Windows Picture 3
- Accept the user agreement, and then select the correct software from the list. Choose either the file ending in i586 for a 32-bit system or the file ending in x64 for a 64-bit system. Save to your Desktop.
How to Run C/C++ Program in Netbeans on Windows Picture 4
- Select the Graphic on the right
- Download Compiler and Debugger
- Select the Correct File for your System and Save it to your desktop
How to Run C/C++ Program in Netbeans on Windows Picture 5
- Select the Correct File for your System and Save it to your desktop
Part 2 of 5:
Installing Cygwin Compiler and Debugger
-
How to Run C/C++ Program in Netbeans on Windows Picture 6
Create a Folder on the Desktop and name it Cygwin - Open the Cygwin Installer
- Click the "Next" button on the window that comes up
-
How to Run C/C++ Program in Netbeans on Windows Picture 7
Click Install from Internet, Click Next, then Click Next on the Second window- Make sure on the Third Window that the path is setup to the desktop folder
How to Run C/C++ Program in Netbeans on Windows Picture 8
- Make sure on the Third Window that the path is setup to the desktop folder
- Select a Download Site and click Next
- Really does not matter what site is chosen, however download speed may be affected
- Install Compiler and Debugger
- On the Window that pops-up select the '+' next to Devel
How to Run C/C++ Program in Netbeans on Windows Picture 9
- Find the files called gcc-core, gcc-g++, gdb: GNU Debugger, and 'make', and click the 'Skip' button to the left ONCE.
How to Run C/C++ Program in Netbeans on Windows Picture 10
How to Run C/C++ Program in Netbeans on Windows Picture 11
- Click Next
- It will install the parts and then ask if you want shortcuts, you do not need these
- On the Window that pops-up select the '+' next to Devel
- Create the Cygwin Path
- Open your control panel and select "System and Security", then select "System"
- Click Advanced System Settings
- Near the bottom of the new window there will be a button called "Environmental Variables", select it
How to Run C/C++ Program in Netbeans on Windows Picture 12
- In the window that pops up scroll down to Path, select it and click Edit
- At the end of the highlighted text (DON'T DELETE IT) add, with no spaces at all, ";cygwin-directorybin"
How to Run C/C++ Program in Netbeans on Windows Picture 13
Part 3 of 5:
Installing Netbeans
-
How to Run C/C++ Program in Netbeans on Windows Picture 14
Open the Netbeans Installer- Allow program to run, if asked for permission, and wait for installer to configure
-
How to Run C/C++ Program in Netbeans on Windows Picture 15
When the installer Opens- Click Next
- Agree to the user agreement and select Next
- Allow the installer to save and install the files on the next two windows to the default locations
- Click Install
- You can choose whether to send usage data or not
Part 4 of 5:
Running the Program
-
How to Run C/C++ Program in Netbeans on Windows Picture 16
Open Netbeans -
How to Run C/C++ Program in Netbeans on Windows Picture 17
Click the "My Netbeans" tab -
How to Run C/C++ Program in Netbeans on Windows Picture 18
Click Install Plugins- In the search bar type C/C++
- Select the result that has the same name and click it
- Click Install
-
How to Run C/C++ Program in Netbeans on Windows Picture 19
Click Next in the new window- Accept the User Agreement and Click Install
-
How to Run C/C++ Program in Netbeans on Windows Picture 20
Exit the Plugin Window -
How to Run C/C++ Program in Netbeans on Windows Picture 21
Click File in the top left corner -
How to Run C/C++ Program in Netbeans on Windows Picture 22
Click New Project -
How to Run C/C++ Program in Netbeans on Windows Picture 23
Select C/C++ in the new window- Select C++ Application on the right side
How to Run C/C++ Program in Netbeans on Windows Picture 24
- Select Next
- Select C++ Application on the right side
-
How to Run C/C++ Program in Netbeans on Windows Picture 25
Name the Project whatever you'd like, and make sure that the tool collection field has Cygwin in it- Click Finish
-
How to Run C/C++ Program in Netbeans on Windows Picture 26
Double-Click the Project on the left-side of the screen- Click the '+' next to Source Files
-
How to Run C/C++ Program in Netbeans on Windows Picture 27
Double-Click main.cpp -
How to Run C/C++ Program in Netbeans on Windows Picture 28
Insert the phrase (No quotes) "#include " underneath the other include phrase -
How to Run C/C++ Program in Netbeans on Windows Picture 29
Insert any code inside the curly brackets of the main function- For example insert (no quotes) "cout << "Hello World" << endl;"
-
How to Run C/C++ Program in Netbeans on Windows Picture 30
Click the hammer icon at the top to build the solution- If done correctly at the bottom in green, a message will appear that reads "Build Successful"
How to Run C/C++ Program in Netbeans on Windows Picture 31
- If done correctly at the bottom in green, a message will appear that reads "Build Successful"
-
How to Run C/C++ Program in Netbeans on Windows Picture 32
Run the code by clicking the play button- At the bottom your output should be there, followed by a message that reads "Run Successful" with total runtime of your program
How to Run C/C++ Program in Netbeans on Windows Picture 33
- At the bottom your output should be there, followed by a message that reads "Run Successful" with total runtime of your program
Part 5 of 5:
Troubleshooting
-
How to Run C/C++ Program in Netbeans on Windows Picture 34
- Be sure to install the Cygwin compiler and debugger first. It allows the IDE to auto-find it in your system
- If Cygwin does not appear in the tool collection field, be sure that its path is added to the Environment Variables
- If the project does not build or run correctly, be sure to look carefully at the final screenshot and make sure that all parts in the text editor look the same
3.7 ★ | 10 Vote
You should read it
- How to Play Sounds for Calendar Notifications on a Mac
- Corel Draw: Draw the Windows XP icon
- Please download more than 90 beautiful windows wallpapers for your computer
- How to Install Windows 10 on a Mac
- How to turn on the window to select the location for saving files when downloading on Chrome, Coc Coc, Firefox browsers
- How to Install VMware Player
- How to Install Software from Unsigned Developers on a Mac
- How to add 'Open command window here as administrator' to the right-click menu on Windows 10
- Two computer worms spread dangerously in Vietnam
- How to Install Windows from Ubuntu
- How to Install Ubuntu Packages
- How to Install and Configure Tmux for Linux