Tag Archives: valgrind

Netbeans C/C++ template with Valgrind and -Wall

Netbeans is a great free IDE, one I recommend to all beginners.

For C/C++ coding, it has one important drawback though: -Wall is not selected by default, which is something absolutely required for beginners.

For this reason, I have created my own template (-wall, run at external terminal, valgrind configuration etc) which is available here

In the following page you can find how to create and use one of your own:


Basically you point the IDE to an existing NetBeans project and tell it to use that as a template. You use a module project as a wrapper: This will allow you to turn the template project into an NBM file (“NetBeans Module”) that can be installed into the IDE like a plugin. After installing the custom plugin, the template project will appear in the “New Project” wizard. This is how you do it:

  1. Take a NetBeans project that you want to be the template project, and open it in the IDE. Let’s call it FooApp.
  2. Create an empty NetBeans Module project. Name it something recognizable (such as FooAppTemplate or whatever).
  3. In the Projects window, right-click the empty module project. Create a new file by choosing New > Other > Module Development > Project Template from the context menu.
  4. Use the Template Wizard to configure the template. Point it to the template project FooApp and choose a category (Java SE, Java EE, Java ME, Ruby, etc).
  5. Here comes the important part – you save the template as an NBM file. Right-click the module project in the Projects window, and select Create NBM. Look into the Output window to see where the file was saved (for instance FooAppTemplate/build/myorg-fooapptemplate.nbm).
  6. To install the template into the IDE, go to Tools > Plugins > Downloaded. Click Add Plugin, browse to your NBM file and install it. If you give the NBM file to other developers, that’s how they install the template.
  7. (Alternatively, right-click the module project in the Project window and select “Install in Development IDE”. This is another way to install it for somebody who has the module project still open.)