corner imagecorner image
FeaturesPluginsDocs & SupportCommunityPartners

Defining Your C/C++ Project's Development Environment

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.

Contents

Content on this page applies to NetBeans IDE 6.5

Requirements

To follow this tutorial, you need the following software and resources.

Software or Resource Version Required
NetBeans IDE version 6.5 with NetBeans C/C++ pack
Java Developer Kit (JDK) version 6 or version 5

See the NetBeans IDE 6.5 Installation Instructions for information on downloading and installing the required software.

Installing Tool Collections

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

www.cygwin.com
www.mingw.org
Solaris platforms:
GNU C and C++ compilers
Sun C and C++ compilers
Solaris make and gmake
gdb

3.4.3
5.9 (Sun Studio 12 release)
3.80
6.6 or 6.8
Linux platforms:
Red Hat Fedora Core:
gcc and g++
gdb
GNU make

Ubuntu:
gcc and g++
gdb
GNU make

4.1.2
6.6 or 6.8
3.81


4.1.2
6.6 or 6.8
3.81
Mac OS X platforms:
gcc and g++
gdb
GNU make
Xcode bundle

4.0.1
6.3.50
3.80
6.5

See the following documents for instructions on installing and configuring these 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).

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

  1. Choose Tools > Options.
  2. Click C/C++ in the top pane of the Options dialog box.
  3. On the Build Tools tab, click Edit next to the Development Host drop-down list.
  4. In the Development Hosts Manager dialog box, click Add.

  5. Screenshot of Development Hosts Manager dialog box

  6. 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.

  7. Screenshot of Add New Server dialog box

  8. The IDE connects to the remote host and the new host is added to the list of development hosts.

  9. Screenshot of Development Hosts Manager dialog box

  10. 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.


  11. Screenshot of Edit Path's Map dialog box

  12. 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:

  1. Click Add.
  2. 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.
  3. 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.



  4. 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:

  1. Right-click the project in the Projects window and choose Properties.
  2. In the Project Properties dialog box, select the Build node in the Categories list.
  3. In the build tools properties, select a collection from the Tools Collection dropdown list .

  4. Screenshot of Build panel of Project Properties dialog

  5. Click OK.

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