Entries Tagged as 'Development'

NetBeans for C/C++ on Windows


I’ve been a fan of the NetBeans environment for developing for a long time.  Yes, there’s a great deal of resistance to it because it’s not OpenSource (it’s an Oracle sponsored project), but it’s free for Windows, OS-X, and Linux.

Many think NetBeans is only an IDE for Java development.  That’s definitely not the case.  NetBeans will do Java, HTML5, C/C++, Fortan, Groovy, PHP, and many more (with plug-ins)… and works with both Tomcat and GlassFish (GlassFish is actually bundled with several NetBeans packages — but you do not have to install it if you’re not going to use it).

NetBeans is written in Java, and you need not only a JRE (runtime), but also a JDK (development kit)… on Java.com (also an Oracle project — they purchased Sun) you can download bundles for many operating systems including JRE, JDK, and NetBeans (you can also install them individually).

Getting NetBeans and C/C++ to work on Linux is a snap, you just need your development tools setup before you install / run NetBeans.  I’d considered install on Windows pretty straight forward as well, but since I’ve helped two different people get it working in the last week, and several a few months ago I’m going to write a quick list of the steps involved.


While not all of these steps need to be done in the order I’m listing them in, unless you really know what you’re doing (and why would you be reading this if you already know how to make this work), just follow the steps.  If you have any problems getting this to work, use my contact page — I definitely want to improve my instructions (no — I’m not going to put screen shots and make it a guide for people who’ve never seen a computer before… it’s a development environment, so I’m working on the premise you either know C/C++ or you’re taking a class in it).

At the end of the article are some links that might help (please search the internet if the links are broken).

  1. Download and install the latest JRE (or the one you’ve been told to if taking a class).
  2. Download and install the latest JDK (or the one you’ve been told to / matches the JRE).
  3. Download and install the latest NetBeans full package (it’s the right most column, if you’re worried about disk space, don’t install GlassFish).
  4. Download and install MinGW in C:\MinGW
  5. Run the mingw-get-setup.exe file and select the C++ compiler, development environment, MSYS
    base (we’ll install the rest in the next step).
  6. Download and install MSYS into C:\MinGW\msys\1.0 (watch the navigation pane to insure you don’t get an extra 1.0 in the path).  Let the install “normalize” (that’ll remove duplicate copies of tools.
  7. Add the following to the Windows path (you will need admin rights — if you don’t have admin rights then you’ll have to launch NetBeans through a batch file that adds them to the windows path before executing NetBeans).
    • c:\MinGW\bin
    • c:\MinGW\MSys\1.0\bin
  • Launch NetBeans and do the following:
    • tools->plugins
      insure C++ is installed/enabled
    • tools->preferences->C++
      if necessary add the MinGW toolchain and accept defauls (NetBeans should locate all the required components).
  • Now just create a “Hello World” project and insure that it works.



Originally posted 2015-02-07 15:00:29.