Defining Your C/C++ Project's Development Environment
Contributed and maintained by
September 2008 [Revision number: V6.5-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.5.
Netbeans C/C++ pack minimally requires a C compiler, C++ compiler, make utility, and
gdb debugger. NetBeans C/C++ pack has been tested with the following compilers
and tools.
Software or Resource
Version Required
Windows platform:
GNU C and C++ compilers, make, gdb
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).
You can define remote development hosts in the Build Tools tab of the C/C++
panel of the
Options window. A remote development
host contains the system name of the host and a login name, and requires a password.
To develop a project on a
remote host, the project must be on a shared filesystem that is visible
on both the local host and the remote host. Typically such a filesystem
is shared using NFS or Samba. You can define the mapping between local and
remote paths to project source files when you define the remote host. The
remote host must support SSH2 (Secure Shell) connections.
When you create a project, the current development is selected
as the development host for the project. You can change the
development host for the project on the Build panel of the Project Properties
dialog box.
Adding a Remote Host
Choose Tools > Options.
Click C/C++ in the top pane of the Options dialog box.
On the Build Tools tab, click Edit next to the
Development Host drop-down list.
In the Development Hosts Manager dialog box, click Add.
In the Add New Server dialog box, type the name of the host in the
Development Server Field. Change the default Login name if needed. Type your
password in the Password field and click OK.
The IDE connects to the remote host and the new host is added to the list of development hosts.
To map the project sources on the local host to the new remote host, click
Path Mapper. In the Edit Path's Map dialog box, select the remote host in the
Host drop-down list. For each mapping, type the local path to project sources
in the Local Path field and the corresponding remote path in the Remote Path
field. Click OK.
Note: In many cases, NetBeans C/C++ pack can determine path map information
without user intervention.
Click OK in the Development Hosts Manager dialog box.
Using the Tool Collection List
The tool collection list displays the collections found on the current development
host. The default collection is listed in bold type. This collection is
selected for any new project you create. You can change the
tool collection for a specific project in the project properties.
For the local host, 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.
Adding a Tool Collection to the List
To add a tool collection to the list:
Click Add.
In the Add New Tool Collection dialog box, type the base directory path for the new
collection in the Base Directory text field, or use the Browse button to navigate to the
path.
The Tool Collection Family and Tool Collection Name are filled in automatically. 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, select a collection from the Tools Collection
dropdown list .