This article is a step-by-step tutorial to help you set up C/C++ in your NetBeans 6.9.1 IDE on your openSUSE 11.2 OS. These instructions should be easy to modify for any GNU/Linux-based OS too!
Things You’ll Need
- NetBeans 6.9.1 – The Smart Way to Code
- openSUSE 11.2 (But any GNU/Linux-based OS will do!)
- A Terminal window
Let’s install the required tools from the GNU Compilers Collection. Here is a list of tools that you’ll need:
- C Compiler: gcc
- C++ Compiler: g++
- Assembler: as
- Make Command: gmake
- Debugger Command: gdb
- CMake Command: cmake (I think this one is optional; but I’m not sure! So let’s install it anyway!)
At your terminal window, enter the following command,
sudo zypper install gcc gcc-c++ binutils gmake gdb cmake
zypper is the package manager used by openSUSE 11.2 at the terminal. For Ubuntu, you might have to enter something like,
sudo apt-get install gcc gcc-c++ binutils gmake gdb cmake
I’m not sure, just check on the Internet.
Moving on, enter your root password and let zypper (or your package manager) install the necessary packages.
Setting up NetBeans…
Once you’re done, follow the steps below:
- Open your NetBeans IDE and goto Tools > Options.
- Click on the C/C++ tab.
- You should see a window similar to the one below, but with empty fields.
- Click on the Add… button near the bottom-left corner.
- Enter the Base Directory as /usr/bin and press the Tab key.
- NetBeans will automatically select the Tools Collection name as GNU from the combo-box.
- Enter a nice name at the Tools Collection Name like GNU Compiler Collection or something.
- Click OK.
- Your Options window should now look similar to the Options window image shown above (after step 3.)
- Congratulations, your NetBeans IDE should now be ready to run C/C++.
Comment back here if you need any help regarding this. I’d be happy to help!
If you have any suggestions for improvements, please comment!