How to Run C/C++ Program in Netbeans on Windows

September 2022 ยท 2 minute read

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 2 of 5:

Installing Cygwin Compiler and Debugger

  • Picture 6 of How to Run C/C++ Program in Netbeans on Windows

    Create a Folder on the Desktop and name it Cygwin

  • Open the Cygwin Installer
  • Click the "Next" button on the window that comes up
  • Picture 7 of How to Run C/C++ Program in Netbeans on Windows 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 Picture 8 of How to Run C/C++ Program in Netbeans on Windows
  • 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 Picture 9 of How to Run C/C++ Program in Netbeans on Windows
  • Find the files called gcc-core, gcc-g++, gdb: GNU Debugger, and 'make', and click the 'Skip' button to the left ONCE. Picture 10 of How to Run C/C++ Program in Netbeans on Windows Picture 11 of How to Run C/C++ Program in Netbeans on Windows
  • Click Next
  • It will install the parts and then ask if you want shortcuts, you do not need these
  • 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 Picture 12 of How to Run C/C++ Program in Netbeans on Windows
  • 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" Picture 13 of How to Run C/C++ Program in Netbeans on Windows
  • Part 3 of 5:

    Installing Netbeans

  • Picture 14 of How to Run C/C++ Program in Netbeans on Windows Open the Netbeans Installer
  • Allow program to run, if asked for permission, and wait for installer to configure
  • Picture 15 of How to Run C/C++ Program in Netbeans on Windows 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 5 of 5:

    Troubleshooting

  • Picture 34 of How to Run C/C++ Program in Netbeans on Windows
  • 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
  • Samuel Daniel Samuel Daniel

    Update 05 March 2020

    ncG1vNJzZmismaXArq3KnmWcp51ktbDDjK2mZqqlo3qkr4ypqaifopa6brXNZqWerJKarq%2B%2FjKilZq%2BZo7Gww9I%3D