corner imagecorner image
FeaturesPluginsDocs & SupportCommunityPartners

Installing C/C++ Development Tools on Linux

Content on this page applies to NetBeans IDE 6.0, NetBeans 6.1, and
NetBeans 6.5 In order to build and debug C/C++ executables and libraries on Linux, a minimal set of development tools must be installed. These tools are not bundled with the NetBeans C/C++ pack. This how-to tells how to install supported versions of these tools.

For more information about working with C/C++ applications in the NetBeans IDE, see the C/C++ Applications Learning Trail page on the NetBeans web site.

Tutorial Requirements


Before you proceed, make sure you review the requirements in this section.

Software Needed for This Tutorial

Before you begin, you need to install NetBeans IDE 6.5. The C/C++ installer option includes NetBeans IDE 6.5 and C/C++ support. If your initial NetBeans download did not include the C/C++ pack, you'll need to go to the Available Plugins tab on the Tools > Plugins menu and install the C/C++ plugin.

Which Tools to Use?

Linux developers have several choices for development tools:

  1. GNU Development Tools
  2. Sun Studio 12 Compilers

Most Linux distributions supply GNU development tools as an optional bundle. Unfortunately, the bundle names vary for each Linux distribution. Most Linux distributions also have different tools for automatically installing these bundles.

GNU Development Tools

The GNU development tools (gcc, g++, gmake, and gdb) are the primary tools for C/C++ development using the NetBeans IDE. The following list tells how to install these tools on various Linux distributions. Before running the following commands, check whether the tools are already installed on your system.

  • Ubuntu 7.xx
  •          sudo apt-get install gcc g++ gdb make 
  • Red Hat Fedora Core
  •          sudo yum install gcc g++ gdb make 
  • Other Linux Distributions
  • Other Linux distributions have similar commands for installing optional software. Check your Linux distribution for how to install these programs.

In most cases these tools need to be installed as root. If not, you can skip the sudo portion of the above commands.

Sun Studio 12 Compilers

If you want to use the Sun Studio 12 compilers:

  • If you have Sun Studio 12 software installed, ensure that /installation directory/sunstudio12/bin is in your path before you start the NetBeans IDE.
  • If you do not have Sun Studio 12 software installed, you can download it free at http://developers.sun.com/sunstudio/downloads/.

To download and install the Sun Studio 12 compilers:

  1. Create a directory for the downloaded file. You must have write permission for this directory.
  2. Download the file for your platform into the download directory.
  3. Go to the download directory, and uncompress and untar the downloaded file.
        bzcat filename | tar xvf -
                   
  4. Follow the instructions in Chapter 2 of theSun Studio 12 Quick Installation (English, Japanese, Simplified Chinese) guide guide to install the C and C++ compilers.

Add the path to the Sun Studio software to your PATH before starting the NetBeans IDE.

top

Bookmark this page

del.icio.us furl simpy slashdot technorati digg
Companion
Projects:
MySQL Database Server   GlassFish Community: an Open Source Application Server   Open Solaris  Open JDK: an Open SourceJDK   Mobile & Embedded Community     Sponsored by 
Sponsored by Sun Microsystems