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

Part 1 of 3:

If you have NetBeans IDE 8.0 without the C/C++ plugin

If your NetBeans IDE does not show a C/C++ project category when you select File > New Project, complete the following steps to add the C/C++ plugin module to the IDE.

  1. How to Run Program C/C++ Program in Netbeans Picture 1
    If your network uses a proxy, choose Tools > Options > General in the IDE, select Manual Proxy Settings, enter the HTTP Proxy and Port for your proxy, and click OK.
  2. How to Run Program C/C++ Program in Netbeans Picture 2
    Choose Tools > Plugins.
  3. How to Run Program C/C++ Program in Netbeans Picture 3
    In the Plugins dialog box, click the Available Plugins tab, and scroll to the C/C++ category.
  4. How to Run Program C/C++ Program in Netbeans Picture 4
    Select the C/C++ checkbox and click Install to start the NetBeans IDE Installer.
  5. How to Run Program C/C++ Program in Netbeans Picture 5
    In the NetBeans IDE Installer, click Next.
  6. How to Run Program C/C++ Program in Netbeans Picture 6
    Read the license agreement, select the checkbox to accept the terms of the license agreement, and click Next.
  7. How to Run Program C/C++ Program in Netbeans Picture 7
    Click Install.
  8. How to Run Program C/C++ Program in Netbeans Picture 8
    After the installation completes, select either Restart IDE Now or Restart IDE Later and click Finish.
Part 2 of 3:

Installing and Setting Up the Compilers and Tools

  1. How to Run Program C/C++ Program in Netbeans Picture 9
    Compile. After installing the Plug-In, you then require a compiler for compiling C/C++ Codes. The NetBeans C/C++ module has been tested with compilers from Cygwin and MinGW. If you install both Cygwin and MinGW, be careful to keep their installation locations completely separate and do not mix tools from Cygwin and MinGW in one tool collection in the IDE. Install the GNU gcc and g++ compilers, make, and gdb debugger from cygwin.com as follows.
  2. How to Run Program C/C++ Program in Netbeans Picture 10
    Download the Cygwin setup-x86.exe (32-bit installation) or setup-x86_64.exe (64-bit installation) program by clicking Install Cygwin in the left navigation bar, or by clicking the direct setup-x86.exe or setup-x86_64.exe link. Note: The bits of Windows OS, Java, and NetBeans IDE installed on your machine must match. For example, if you are running the 64-bit version of Windows operating system, 64-bit Java and 64-bit Cygwin (that is setup-x86_64.exe) are required to be installed.
  3. How to Run Program C/C++ Program in Netbeans Picture 11
    Run the downloaded Cygwin installer. Accept the defaults until you reach the Select Your Internet Connection page. Select the option on this page that is best for you. Click Next.
  4. How to Run Program C/C++ Program in Netbeans Picture 12
    On the Choose Download Site page, choose a download site you think might be relatively close to you. Click Next.
  5. How to Run Program C/C++ Program in Netbeans Picture 13
    On the Select Packages page you select the packages to download. Click the + next to Level to expand the development tools category. You may want to resize the window so you can see more of it at one time.
  6. How to Run Program C/C++ Program in Netbeans Picture 14
    Select each package you want to download by clicking the Skip label next to it, which reveals the version number of the package to download. At a minimum, select The ones Outlined Below. Packages that are required by the packages you select are automatically selected as well.
    1. gcc-core: C compiler
    2. gcc-g++: C++ compiler
    3. gdb: The GNU Debugger
    4. make: the GNU version of the 'make' utility
  7. How to Run Program C/C++ Program in Netbeans Picture 15
    Click Next to connect to the download site and download the packages you selected, and click Finish when the installation is complete.
  8. How to Run Program C/C++ Program in Netbeans Picture 16
    Now add the Cygwin compiler directory to your path to enable NetBeans IDE to find the tools collection:
    1. Open the Control Panel: - On Windows XP select Start > Settings > Control Panel and double-click System. - On Windows 7, type var in the Start menu's search box to quickly find a link to Edit the system environment variables.
    2. Select the Advanced tab and click Environment Variables.
    3. In the System Variables panel of the Environment Variables dialog, select the Path variable and click Edit.
    4. Add the path to the cygwin-directorybin directory to the Path variable, and click OK. By default, cygwin-directory is C:cygwin (for 32 bit Cygwin distribution) or C:cygwin64 (for 64 bit Cygwin distribution). Directory names must be separated with a semicolon. Your edited path should look something like %SystemRoot%system32;%SystemRoot%;C:Program FilesQuickTimeQTSystem;C:cygwinbin
    5. Click OK in the Environment Variables dialog and the System Properties dialog.
    6. See Verifying the Installation to verify that the tools were installed correctly for the NetBeans IDE.
Part 3 of 3:

MinGW Compilers and Tools

NetBeans IDE 8.0 was tested with Minimalist GNU for Windows (MinGW) and the Minimal System (MSYS) Unix-like environment. Versions tested and installation instructions are shown below. To install the GNU compilers, make, and gdb debugger from mingw.org:

  1. How to Run Program C/C++ Program in Netbeans Picture 17
    Log in to Windows using an account with computer administrator privileges.
  2. How to Run Program C/C++ Program in Netbeans Picture 18
    Download the MinGW installer from http://sourceforge.net/projects/mingw.
  3. How to Run Program C/C++ Program in Netbeans Picture 19
    Run the MinGW installer, which should have a file name similar to mingw-get-setup.exe.
  4. How to Run Program C/C++ Program in Netbeans Picture 20
    Accept the default C:MinGW as the destination folder if possible to minimize any potential difficulty with using the compilers from another location.
  5. How to Run Program C/C++ Program in Netbeans Picture 21
    In the MinGW installer select the following components to install:
    1. mingw-developer-toolkit
    2. mingw32-base
    3. mingw32-gcc-fortran (if you will be working on Fortran programs)
    4. msys-base
    5. mingw32-gcc-g++
  6. How to Run Program C/C++ Program in Netbeans Picture 22
    Select Installation > Apply Changes from the main menu.
  7. How to Run Program C/C++ Program in Netbeans Picture 23
    Click Apply to confirm the installation and wait a few minutes while the installer program downloads the components you selected.
  8. How to Run Program C/C++ Program in Netbeans Picture 24
    You must add the paths to the the binaries for MinGW and MSYS tools to your PATH. If you installed to the default location the paths are C:MinGWbin and C:MinGWMSYS1.0bin.
    1. Click Close when the packages installation is completed.
4.3 ★ | 7 Vote

May be interested

  • What is a sandbox and how does it sandbox a program?What is a sandbox and how does it sandbox a program?
    many browsers today are designed to automatically run in their own sandbox without user settings.
  • Instructions for uninstalling Windows Insider ProgramInstructions for uninstalling Windows Insider Program
    the windows insider program allows you to experience new features early, but it comes with the risk of system errors and instability. if you no longer want to use this test build, exiting the program is necessary to ensure performance and stability of your computer.
  • Microsoft rewarded $ 250,000 in a new bug-finding programMicrosoft rewarded $ 250,000 in a new bug-finding program
    microsoft finally launched a bug bounty program for security researchers and bug hunters, and then reported bugs on the latest windows operating systems and software.
  • How to Run a Program on Command PromptHow to Run a Program on Command Prompt
    this wikihow teaches you how to start a program on your windows computer from within the command prompt app. you can only run programs that are installed in windows-created folders (e.g., the desktop), though you can add a program's folder...
  • How to Open a File with Another Program Using Open With on Windows VistaHow to Open a File with Another Program Using Open With on Windows Vista
    do you have a file on your computer which seems to always open in another program that you don't want to use? although the program is on your system, it's just not accessing it for either this instance or for all instances. this article...
  • Basic C program structureBasic C program structure
    before we study the blocks that make up a c program, first look at a sample c program.
  • 8 tools to hide programs running on Taskbar or Traybar8 tools to hide programs running on Taskbar or Traybar
    if you want to hide a program or application running on the taskbar for some reason, you don't know how. the network administrator will introduce you to 8 useful tools to help you hide the program in the taskbar.
  • ADX Toys 2: Programming editor for WordADX Toys 2: Programming editor for Word
    programming requires you to have a suitable program and a specific environment, plus a translation program to translate the source program. however, when you want to interpret a certain meaning content in a language, you need to write it into a text to express your meaning.
  • 3 ways to end a program in Python3 ways to end a program in Python
    knowing how to end a program is important and can be helpful in many different situations. for example, if you're creating a simple game, you can exit when a specific user enters or when a certain condition is met.
  • How to join the Apple Beta program to try the latest iOS versionsHow to join the Apple Beta program to try the latest iOS versions
    apple has provided a free beta program for users (public beta), previously you need to pay 99 usd / year. and you can sign up for this apple program right now according to the instructions below.