Defining Your C/C++ Project's Development Environment
Contributed by Ann
Rice and maintained by
Susan Morgan
June 2010 [Revision number: V6.9-1]
The following short tutorial takes you through the basic
steps of selecting the development host and tool collection for building and
debugging a C or C++ project in NetBeans IDE 6.7, 6.8, or 6.9.
Contents
Requirements
To follow this tutorial, you need the following software and resources.
See the NetBeans IDE
6.9 Installation
Instructions for information on downloading and installing the required software.
Installing Tool Collections
The Netbeans C/C++ module minimally requires a C compiler, C++ compiler, make utility, and
gdb debugger. The NetBeans C/C++ module has been tested with the compilers
and tools listed in C/C++ Tool Collections Tested with NetBeans IDE.
See
Configuring the NetBeans IDE for C/C++/Fortran for instructions on
installing and configuring the required tools.
Specifying the Development Host
You can build, run, and debug your project on the local host (the system
from which you started the IDE) or on a remote host running a UNIX®
operating system. Only the Solaris and Linux operating systems have been
tested as remote development hosts. Initially, the IDE is set up to use the
local host only.
You can define remote development hosts in the Build Tools tab of the C/C++
panel of the Options window, as described in the
C/C++ Remote Development Tutorial.
Using the Tool Collection List
The tool collection list is in the Tools > Options > Build Tools tab. The
list displays the collections found on the currently selected development
host. The default collection is listed in bold type, and is selected for any
new project you create. You can change the
tool collection for a specific project in the project properties.
The tool collection is associated with the development host, so you must
be sure the correct development host is selected before working with the
tool collection list. For local or remote hosts, you can modify the
Tool Collection list by adding or removing collections.
Changing the Default Tool Collection
To change the default tool collection, select a collection from the Tool Collection list
and click Default. The new default tool collection will be selected for any new projects
you create using the selected development host.
Adding a Tool Collection to a Development Host
When you add a tool collection, you make the compilers available to the IDE. The tools
must be installed on the system already.
To add a tool collection associated with a development host:
- Select the Development Host where you want to add a tool collection.
- In the Tools > Options > Build Tools tab, click Add under the Tool Collection list.
- In the Add New Tool Collection dialog box, type the directory path for
the tool collection's executable files in the Base Directory field, or use the Browse button to navigate to the
directory.
Note that in NetBeans IDE 6.7 and 6.8, if the Development Host is not localhost, the Browse feature is not
available. You must type the complete path to the base directory of the tools on
the remote server. Click Check to have the IDE check that the path you have entered
is valid for a supported tool collection. You might be prompted to log in to the server
to check the path. In NetBeans IDE 6.9, the Browse feature is available for remote hosts.
- The Tool Collection Family and Tool Collection Name are filled in automatically for
valid paths. You can specify a
different name for the collection. If you change the family to another family on the
dropdown list, make sure that the family you specify is the correct family for the
collection or the compiler flags might not be valid.
- Click OK.
Changing the Tool Collection for a Project
When you create a project, the current default tool collection is selected as the tool
collection for the project. You can change the tool collection for your project to another
collection on the collection list, or you can customize a tool collection especially for
the project.
To select a different tool collection for an existing project:
- Right-click the project in the Projects window and choose Properties.
-
In the Project Properties dialog box, select the Build node in the Categories list.
- In the build tools properties, make sure the Development Host is set to the host you want to build on.
- Select a collection from the Tools Collection
dropdown list .
- Click OK.
The next time you build the project, the selected tool collection will be used.
See Also
Please see the
C/C++ Learning Trail for
more articles about developing with C/C++/Fortran in NetBeans IDE.