C C++ Development Toolkit User Guide
C C++ Development Toolkit User Guide
This guide provides instructions for using the C/C++ Development Toolkit (CDT) in the workbench. Getting Started Concepts Tasks Reference Before you begin What's new
Build (such as make). Compile (such as gcc). For more information, see http://gcc.gnu.org. Debug (such as gdb). For more information, see http://sources.redhat.com/gdb/.
Tip: Cygwin contains these utilities for a Windows environment. For more information, see http://www. cygwin.com. To test if cygwin was installed correctly open a command prompt and type g++ or make. The following error message means that no make is installed or your path is not configured correctly. 'g++' (or 'make') is not recognized as an internal or external command, operable program or batch file To check your path open a command prompt and type PATH. Make sure that the path to your build utility is defined (example PATH=c:\cygwin\bin).
CDT Home
Enhanced Performance
Builds can now be performed in the background. Searches can now be performed in the background.
Enable C/C++ indexing and indexer error reporting in the C/C++ Indexer properties. This helps identify projects missing path configuration information.
Open Type
Use Open Type to open up the declaration of C/C++ classes, structures, unions, typedefs, enumerations and namespaces.
Automatic Refresh
Configure the default behavior of the automatic retrieval of shared library and register information in the C/C++ debugger.
Improved Search
Search now supports external files referenced using #include.
C/C++ Search
You can search the projects in your workspace for references to, declarations or definitions of, particular elements. Only header files referenced by a source file in your workspace are included in a search.
Build
Managed build
You can now create a Managed build and have makefiles generated for you.
Error parser
The error parsers are now extension-points that can contributed by other plug-ins. The error parsers are used to detect errors or warnings or informational messages from compilers, linkers, etc... during a build.
Make project options You can now make changes the Error Parser Configuration. You can change the order in which error parsers are applied or disable them entirely. You can also specify which paths to include during a Make and customize preprocessor symbols to ensure proper indexing and search capabilities. Notes: There are a number of "build error parsers" (the things that turn compiler error messages into objects that we can put into the error lists). If one parser cannot figure out what the message means, then the system moves to the next one in the list. Make target Make targets now support Stop on error build option and ability to change the default build command. New Standard Make projects Old Standard Make projects will be automatically updated to support the new options. If update is declined, then selecting Update Old Make project... from the context menu of the project will update the project to a new Standard Make project.
Debug
Formatting of variables and expressions
You can now select the number system (natural, decimal, hexadecimal) used to display variables and expressions.
Source location
A new source locator in the Run/Debug dialog box makes it possible to add directories to search, mapping, and the order of the search.
Getting Started
How to bring C/C++ source into Eclipse Updating the CDT
CDT Home
all source code for the project is available on or beneath the root folder the build results are also produced in or beneath the root folder there is often a makefile in the root folder. In complex projects, the makefile in the root folder calls other makefiles in other directories to produce the build results. external header files and library files do not need to be in or beneath the root folder.
The resources for the project are maintained in the remote location specified, not in the workspace folder for Eclipse. However, your existing folder structure is displayed in the C/C++ Projects view. Meta data
for the project, such as the index for the project and the link to the existing source, is stored in the metadata directory in the workspace folder. For more information on the workspace folder, see Workbench User Guide > Tasks > Upgrading Eclipse. Once you create a CDT project, you cannot easily move it or redefine its root folders. If you need to, you can delete the CDT project (without deleting its contents) and then recreate it specifying a different nondefault location.
Importing your existing file system can consume significant disk space depending on the size of your files. Your files may become detached from an existing source control system that previously referenced the original file location such as a ClearCase view.
Project properties
2. In the Feature Updates window select Search for new features to install and click Next.
3. If you have not updated previously, you will have to enter the location of the CDT Install site. Click the Add Update Site... button.
4. In the New Update Site dialog box, enter a name and the URL for the update site in the spaces provided.
5. Select the update site you just created by clicking the appropriate checkbox and click Next.
6. A dialog box will appear showing the updates available from the update site, select each of the following features, ensuring you have precisely the same version for each one: r Eclipse C/C+ Development Tooling SDK r Eclipse C/C+ Development Tools Then click Next.
7. You should now see the Eclipse.org Software User Agreement, you must accept the agreement to install the CDT update. Do so by selecting I accept the terms in the license agreement and then click Next.
8. Now select the location you would like the updates installed, usually this is the directory where you installed Eclipse, and click Finish.
9. You will now start downloading the CDT components. You will have to verify that you want the features installed by clicking Install for each feature you selected.
10. You will now have to restart Eclipse, select Yes to complete the update.
Concepts
Provides background information for CDT components, tasks and objectives. CDT Overview CDT Projects Perspectives available to C/C++ developers Views in the C/C++ perspective Coding aids Comments Content Assist Templates Editing C/C++ Files C/C++ editor C++ Makefile Navigation aids Outline View Project File views Make Targets View Open declaration Open Type Class Browser Heirarchy View Build Building C/C++ Projects Manage Build Extensibility Document Debug Breakpoints Debug overview Debug information Error Parsing Invoking Make C/C++ search C/C++ Indexer C/C++ Indexer Problem Reporting C/C++ Indexer Opening or Closing a project C/C++ Indexer Progress Bar
CDT Overview
The C/C++ Development Toolkit (CDT) is a set of Eclipse plug-ins that provide C and C++ extensions to the Eclipse workbench. For more information about Eclipse, see Workbench User Guide > Concepts > Workbench. The CDT provides a C/C++ IDE that simplifies many of the same tools that you can use from the command line. The CDT can also communicate with many external utilities and interpret their responses, for example:
q q q
Build (such as make). Compile (such as gcc). For more information, see http://gcc.gnu.org. Debug (such as gdb). For more information, see http://sources.redhat.com/gdb/.
Note: while make, gcc and gdb are the examples used in the documentation, virtually any similar set of tools or utilities could be used. The CDT opens as the C/C++ perspective of the Eclipse workbench. The C/C++ perspective consists of an editor and the following views: C/C++ Projects Shows your C/C++ projects and files.It operates in much the same way as the Navigator. Console Displays your program's output, as well as the output from your build and external tool chain. Editor The C/C++ editor view provides specialized features for editing C/C++ related files. Make Targets Enables you to select the make targets you want to build in your workspace. Navigator Shows all of the file system's files under your workspace directory. Outline Displays the structure of the file currently open in an editor. Problems View If you encounter any errors during a build they will be displayed in the Problems view. Properties Shows the attributes of the item currently selected in a view or an editor. Search Shows the results of searches for files or text. Tasks Lists tasks that you want to keep track of, either as a schedule of things to do or a history of
things that have been done. For more information, see Workbench User Guide > Concepts > Perspectives.
CDT updates
The Install/Update wizard provides information about your current Eclipse installation and provides the framework to manage your updates. For more information, see Workbench User Guide > Tasks > Updating features with the update manager. To view a list of the updates available for the toolsets that you installed, click Help > Software Updates > New Updates.
Additional information
For more information on the Eclipse CDT project, refer to http://www.eclipse.org/cdt/:
q q q
CDT newsgroup: The place to ask questions about how to use the CDT. User FAQ: Provides answers to the most common questions about using the CDT. Developer Documentation: Provides feature and design specifications for building and extending the CDT. CDT Community Webpage: Showcases plug-ins and tools developed by and for the CDT Community. If you have tools or plug-ins that you would like to submit to the CDT Community Page, use the CDT Development Mailing List or the Eclipse Tools CDT newsgroup.
License
The CDT is an open source project and is licensed under the Common Public License.
Views
CDT projects
Before you can work in the CDT, you must create a project to store your source code, makefiles, binaries, and related files. C/C++ projects are displayed in the C/C++ Projects view. Tip: Nested projects are not supported. Each project must be organized as a discrete entity. Project dependencies are supported by allowing a project to reference other projects that reside in your workspace. For more information, see Selecting referenced projects. For more information about projects and where they are stored, see:
q q
Workbench User Guide > Tasks > Resources Workbench User Guide > Tasks > Running Eclipse
Project types
You can create a standard make C or C++ project or a managed make C or C++ project.
Project conversion
You can convert projects from C to C++ (or from C++ to C). If, for example, your requirements change and you must convert an existing C project to C++, you can do this without recreating the project. The CDT converts your project files and resolves any source control issues.
When you create a file within a project, a record (local history) of every change is created. For more information about local history, see Workbench User Guide > Reference > User
interface information > Development environment > Local history. Spaces in projects and filenames can cause problems with some tools, such as the make utility or the compiler. Be careful when you use only case to distinguish files and projects. UNIX-based operating system file names are case sensitive, but Windows filenames are not. Therefore, Hello.c and hello. c are separate files in UNIX but overwrite each other in Windows.
For more information about projects, see Workbench User Guide > Concepts > Workbench > Resources.
Working with C/C++ project files Converting a C or C++ nature for a project
You can add views to a perspective. From the menu bar choose Window > Show View > Other and select a new view from the Show View dialog. To reset the current perspective to its original layout, from the menu bar choose Window > Reset Perspective.
The C/C++ development tools contribute the following perspectives to the workbench:
C/C++ Projects (the file navigator for C/C++ resources) Navigator (the file navigator for all Eclipse resources) Console Properties Tasks Make Targets Outline Search
q q q q q q
Registers Memory Display (for use with JDT only) Outline Console Tasks
Other Perspectives
In addition to the perspectives named above and the Resource perspective (which you see when you first start Eclipse), Eclipse also has perspectives that are tuned to other types of development:
q q q q
Adding breakpoints
Console view
You can add views to a perspective. From the menu bar choose Window > Show View > Other and select a new view from the Show View dialog. To reset the current perspective to its original layout, from the menu bar choose Window > Reset Perspective.
The following views are commonly used in the C/C++ perspective: C/C++ Projects Displays, in a tree structure, only elements relevant to C and C++ projects. Console Displays your program's output, as well as the output from your build tools. Editor The C/C++ editor view provides specialized features for editing C/C++ related files. Make Targets Enables you to select the make targets you want to build in your workspace. Navigator Shows all of the file system's files under your workspace directory. Outline Displays the structure of the file currently open in an editor. Problems View If you encounter any errors during a build they will be displayed in the Problems view. Properties Shows the attributes of the item currently selected in a view or an editor. Search Shows the results of searches for files or text. Tasks Lists tasks that want to keep track of, either as a schedule of things to do or a history of things that have been done.
Views
Coding aids
This section provides information on code entry aids. Comments Content Assist Templates
Comments
Comments are lines in a source file that have been marked to be ignored by the compiler. Two styles of comments are supported by current C/C++ compilers:
q q
/* text */ // text
Comment
You can quickly comment out one or more lines of code by inserting the leading characters // at the beginning of the line. To do so, select the line (or lines) of code you want to comment out and press CTRL+/ (slash).
Uncomment
To uncomment select the line (or lines) of code, and press CTRL+\ (backslash). Tip: The characters /* */ on lines that are already commented out, are not affected when you comment and uncomment code.
Multiline comment
You can use the Content Assist feature to insert a multi-line comment before a function. Type com +Ctrl+Space, and the following code is entered at the cursor location: /* * author userid * * To change this generated comment edit the template variable "comment": * Window>Preferences>C>Templates. */
To change the default comment click Window > Preferences > C > Templates. For more information see the Content Assist section.
Content Assist
Content Assist is a set of tools built into the CDT that can reduce the number of keystrokes you must type to create your code. The Content Assist plug-in consists of several components that forecast what a developer will type, based on the current context, scope, and prefix.
Code completion
Content assist provides code completion anywhere in the document. For the current project a list is displayed of the elements that begin with the letter combination you entered, and the relevance of each proposal is determined in the following order:
q q q q q q q q q
You trigger the Code completion feature when you call Content Assist (such as when you type Ctrl+Space), but it is autoactivated when you type ".", "->" or "::".
You can view the signature of each item on the list in a pop-up by pointing to it. You can then select an item in the list to insert it directly into your code.
Code templates
You can create and save code templates for frequently used sections of code, which will be inserted according to scope. The Content Assist feature also provides quick access to code templates. When you enter a letter combination in the C/C++ editor, and type CTRL+SPACE (or right-click and click Content Assist), a list of code elements and code templates that start with the letter combination that you typed is displayed.
You can then select a code template from the list and it is inserted directly into your code.
For example, the code template do while statement contains the following code:
When you select the do code template from the list, you insert the following code: do { } while (condition); If the completion engine finds only one proposal in your templates, that proposal is inserted at the current cursor position. For example if you create a new .cpp file and type mai+CTRL+SPACE the following code is inserted at the cursor location: int main(int argc, char **argv) { }
No Completions
If you invoke Content Assist, but no completions are found a message will be displayed on the status to inform you that the Content Assist parser has timed out.
Code entry
Using Content Assist Creating and editing code templates Importing and exporting code templates
Templates
Templates are sections of code that occur frequently enough that you would like to be able to insert them with a few keystrokes. This function is known as Content Assist; the sections of code that are inserted are known as templates. To input an existing Content Assist template into a file, such as one for an if statement, type the initial character ("i" in this case), then press Ctrl+Space. The templates that begin with that character appear. Double-click on a template to insert it into a file. You can edit existing Code/Content Assist templates or create new ones. From the menu bar choose Window > Preferences > C/C++ > Code Templates.
CDT Overview
Creating and editing code templates Using templates Importing and exporting code templates
Edit menu Content Assist page, Preferences window Code Templates page, Preferences window
C/C++ editor
The CDT provides an editor that gives you specific support for editing C/C++ code. This C/C++ editor is invoked automatically when you edit a C/C++ source file. The C/C++ editor includes the following features:
q q q
You can customize some of the operation of the Editor view from the Window > Preferences > C/C++ > Editor preferences dialog.
CDT Overview
C/C++ editor key binding actions C/C++ editor preferences Outline view for C/C++ Views and editors
Makefile
A makefile is a text file that is referenced by the make command that describes the building of targets, and contains information such as source-level dependencies and build-order dependencies. The CDT can generate a makefile for you, such projects are called Managed Make projects. Some projects, known as Standard Make projects, allow you to define your own makefile.
Sample Makefile
# # # # # A sample Makefile This Makefile demonstrates and explains Make Macros, Macro Expansions, Rules, Targets, Dependencies, Commands, Goals Artificial Targets, Pattern Rule, Dependency Rule.
# Comments start with a # and go to the end of the line. # Here is a simple Make Macro. LINK_TARGET = test_me.exe # Here is a Make Macro that uses the backslash to extend to multiple lines. # This allows quick modification of more object files. OBJS = \ Test1.o \ Test2.o \ Main.o # Here is a Make Macro defined by two Macro Expansions. # A Macro Expansion may be treated as a textual replacement of the Make Macro. # Macro Expansions are introduced with $ and enclosed in (parentheses). REBUILDABLES = $(OBJS) $(LINK_TARGET) # Make Macros do not need to be defined before their Macro Expansions, # but they normally should be defined before they appear in any Rules. # Consequently Make Macros often appear first in a Makefile.
# Here is a simple Rule (used for "cleaning" your build environment). # It has a Target named "clean" (left of the colon ":" on the first line), # no Dependencies (right of the colon), # and two Commands (indented by tabs on the lines that follow). # The space before the colon is not required but added here for clarity. clean : rm -f $(REBUILDABLES) echo Clean done # There are two standard Targets your Makefile should probably have: # "all" and "clean", because they are often command-line Goals. # Also, these are both typically Artificial Targets, because they don't typically # correspond to real files named "all" or "clean". # The rule for "all" is used to incrementally build your system. # It does this by expressing a dependency on the results of that system, # which in turn have their own rules and dependencies. all : $(LINK_TARGET) echo All done # There is no required order to the list of rules as they appear in the Makefile. # Make will build its own dependency tree and only execute each rule only once # its dependencies' rules have been executed successfully. # Here is a Rule that uses some built-in Make Macros in its command: # $@ expands to the rule's target, in this case "test_me.exe". # $^ expands to the rule's dependencies, in this case the three files # main.o, test1.o, and test2.o. $(LINK_TARGET) : $(OBJS) g++ -g -o $@ $^ # Here is a Pattern Rule, often used for compile-line. # It says how to create a file with a .o suffix, given a file with a . cpp suffix. # The rule's command uses some built-in Make Macros: # $@ for the pattern-matched target # $lt; for the pattern-matched dependency
%.o : %.cpp g++ -g -o $@ -c $< # These are Dependency Rules, which are rules without any command. # Dependency Rules indicate that if any file to the right of the colon changes, # the target to the left of the colon should be considered out-ofdate. # The commands for making an out-of-date target up-to-date may be found elsewhere # (in this case, by the Pattern Rule above). # Dependency Rules are often used to capture header file dependencies. Main.o : Main.h Test1.h Test2.h Test1.o : Test1.h Test2.h Test2.o : Test2.h # Alternatively to manually capturing dependencies, several automated # dependency generators exist. Here is one possibility (commented out)... # %.dep : %.cpp # g++ -M $(FLAGS) $< > $@ # include $(OBJS:.o=.dep)
Q1. My Console view says "Error launching builder". What does that mean?
Error launching builder (make -k clean all ) (Exec error:Launching failed) Most probably, the build command (by default "make") is not on your path. You can put it on your path and restart Eclipse. You can also change the build command to something that is on your path. If you are using MinGW tools to compile, you should replace the build command with "mingw32-make".
By default, the make program looks for a file most commonly called "Makefile" or "makefile". If it cannot find such a file in the working directory, or if that file is empty or the file does not contain rules for the command line goals ("clean" and "all" in this case), it will normally fail with an error message similar to those shown. If you already have a valid Makefile, you may need to change the working directory of your build. The default working directory for the build command is the project's root directory. You can change this by specifying an alternate Build Directory in the Make Project properties. Or, if your Makefile is named something else (eg. buildFile.mk), you can specify the name by setting the default Build command to make -f buildFile.mk. If you do not have a valid Makefile, create a new file named Makefile in the root directory. You can then add the contents of the sample Makefile (above), and modify it as appropriate.
Stop.
The standard syntax of Makefiles dictates that every line in a build rule must be preceded by a Tab character. This Tab character is often accidentally replaced with spaces, and because both result in whitespace indentation, this problem is easily overlooked. In the sample provided, the error message can be pinpointed to line 12 of the file "makefile"; to fix the problem, insert a tab at the beginning of that line.
Q4. My Console view says "Target 'all' not remade because of errors".
make -k clean all make: *** [clean] Error 255 rm -f Test1.o Test2.o Main.o test_me.exe g++ -g -o Test1.o -c Test1.cpp make: *** [Test1.o] Error 255 make: *** [Test2.o] Error 255 make: *** [Main.o] Error 255 g++ -g -o Test2.o -c Test2.cpp g++ -g -o Main.o -c Main.cpp make: Target 'all' not remade because of errors. The likely culprit here is that g++ is not on your Path.
The Error 255 is produced by make as a result of its command shell not being able to find a command for a particular rule. Messages from the standard error stream (the lines saying Error 255) and standard output stream (all the other lines) are merged in the Console view here.
Navigation Aids
This section provides information on navigating through the C/C++ Perspective. Outline View Project File views Make Targets View C/C++ search Open declarations Open Type Class Browser
Outline view
The Outline view displays an outline of a structured C/C++ file that is currently open in the editor area, by listing the structural elements.
The Outline view shows the following elements in the source file in the order in which they occur:
q q q q q q q q q q q q q q q q q q
Class Namespace Include Enum Enumerator Field private Field protected Field public Include Method private Method protected Method public Struct Typedef Union Variable Function Macro Definition
You can also sort the list alphabetically. When you select an element in the Outline view, the C/C++ editor highlights both the selected item and the marker bar (left margin). For example, to move to the start of main() in the C/C++ editor, click main() in the Outline view. For more information about the marker bar, see Workbench User Guide > Reference > User interface information > Views and editors > Editor area.
You can select an element in the Outline view, and perform the following actions:
q q q q
Open the C/C++ Search window box. The Search string box is populated and the element type is selected. Complete a text-based search, of a workspace or a specified working set for the selected element. Open a selected .h file in the editor. Rename Refactor
Icons
Hide Fields Hide Static Members Hide Non-Public Members Sort For more information about the Eclipse workbench, see Workbench User Guide > Tasks > Upgrading Eclipse. For more information about Working sets, see Workbench User Guide > Concepts > Working sets.
Comments Content Assist and code completion C/C++ search Open Declarations
Displaying C/C++ file components in the C/C++ Projects view Searching for C/C++ elements
Outline view
Browse the elements of C/C++ source files Build Targets Create new projects, classes, files, or folders Import or Export files and projects Manage existing files (cut, paste, delete, move or rename) Open files in the editor view Open projects in a new window Refactor Restore deleted files from local history Search
Files that you select in the C/C++ Projects view affect the information that is displayed in other views.
Navigator view
The Navigator view provides a hierarchical view of all the resources in the workbench, not just your C/C ++ resources. From this view, you can open files for editing or select resources for operations such as exporting. Right-click any resource in the Navigator view to open a pop-up menu from which you can perform operations such as copy, move, create new resources, compare resources, or perform team operations. For a description of what each menu item does, select an item and press F1. By default, the Navigator view is included in the Resources perspective. To add it to the current perspective, click Window > Show View > Navigator.
Toolbar icons
Icon Name Minimize Console. Minimizes the view. Maximize Console Maximizes the view. Back This command displays the hierarchy that was displayed immediately prior to the current display. For example, if you Go Into a resource, then the Back command in the resulting display returns the view to the same hierarchy from which you activated the Go Into command. The hover help for this button tells you where it will take you. This command is similar to the Back button in a web browser. This command displays the hierarchy that was displayed immediately after the current display. For example, if you've just selected the Back command, then selecting the Forward command in the resulting display returns the view to the same hierarchy from which you activated the Back command. The hover help for this button tells you where it will take you. This command is similar to the Forward button in a web browser. This command displays the hierarchy of the parent of the current highest level resource. The hover help for this button tells you where it will take you. This command collapses the tree expansion state of all resources in the view. Description
Forward
Up
Collapse All
This command toggles whether the Navigator view selection is linked to the active editor. When this option is selected, changing the active editor will automatically update the Navigator selection to the resource being edited. Click the black upside-down triangle icon to open a menu of items specific to the Navigator view. Select Working Set Opens the Select Working Set dialog to allow selecting a working set for the Navigator view. Deselect Working Set Deselects the current working set. Edit Active Working Set Opens the Edit Working Set dialog to allow changing the current working set. Sort This command sorts the resources in the Navigator view according to the selected schema: r By Name: Resources are sorted alphabetically, according to the full name of the resource (e.g., A.TXT, then B.DOC, then C.HTML, etc.) r By Type: Resources are sorted alphabetically by file type/ extension (e.g., all DOC files, then all HTML files, then all TXT files, etc.). Filters This command allows you to select filters to apply to the view so that you can show or hide various resources as needed. File types selected in the list will not be shown in the Navigator. Link with Editor See the toolbar item description above.
Menu
For information about the Navigator view toolbar and icons, see Workbench User Guide > Concepts > Views > Navigator View. For information about the pop up menu in the Navigator view, see Workbench User Guide >
Reference > User interface information > Views and Editors > Navigator View. For information about the Working Sets, see Workbench User Guide > Concepts > Workbench > Working sets.
Open declaration
You can select an element name in your code and quickly navigate to its declaration.
Open declaration will attempt to navigate to the exact declaration of the selected element. Open declaration requires your file to have the proper include paths set up to the declaration. If for any reason open declaration cannot find the declaration, it will display the following message in the status line:
Adding Include paths and symbols Navigate to a C or C++ element's declaration Searching for C/C++ elements
Build
This section describes the build views and terminology. Building C/C++ Projects Manage Build Extensibility Document
Required utilities
You must install and configure the following utilities:
q q q
Note: while make, gcc and gdb are the examples used in the documentation, virtually any similar set of tools or utilities could be used. Tip: Cygwin contains these utilities (make, gcc and gdb) for a Windows environment, while running the cygwin installation ensure gcc and make are selected, they are not installed by default. For more information, see http://www.cygwin.com. Red Hat users, all you need to build your project is included in the Red Hat Linux installation. For other operating systems please refer to your installation documentation.
Build terminology
The CDT uses a number of terms to describe the scope of the build.
Build Project
This is an incremental build (make all, assuming all is defined in your makefile). Only the components affected by modified files in that particular project are built.
Rebuild Project
Builds every file in the project whether or not a file has been modified since the last build. A rebuild is a clean followed by a build.
Workbench User Guide > Concepts > Workbench > Builds Workbench User Guide > Tasks > Building resources
The Console view displays the output of the build tools. The Tasks view displays a list of compiler errors and warnings related to your projects. Makefile targets are displayed in the Make Targets view.
For more information about the Tasks view, see Workbench User Guide > Reference > User interface information > Views and editors > Tasks view.
Getting a makefile
You can either create a C/C++ project for which you supply the makefile or create a C/C++ project for which the CDT generates makefiles automatically. To create a new project, from the menu bar choose File > New > Project. In the dialog that appears:
q
To create a project for which you supply the makefile, select either Standard Make C project or Standard Make C++ project. To create a project for which the CDT supplies a basic makefile, select either Managed Make C project or Managed Make C++ project.
The Console view displays the output of the make utility. The Tasks view displays a list of compiler errors and warnings related to your projects. Build actions display in the Make Targets view.
Building
Author
: Sean Evoy
Revision Date : 10/21/2003 - Version: 0.1.0 Change History : 0.1.0 - Document Creation
Table of Contents
1 Introduction 1.1 Who Needs This Information 1.2 Managed Build System Overview 1.3 The Standard Build System 2 Build Model Grammar Elements 2.1 Model 2.2 Target 2.3 Tool 2.4 Option Category 2.5 Configuration 2.6 Tool Reference 2.7 Option 2.8 Option Reference 2.9 List Option Value 2.10 Enumerated Option Value 3 UI Representation 3.1 New Project Wizard 3.2 Build Property Page 4 Makefile Generation 4.1 Main Makefile 4.2 Makefile Fragments 4.3 Dependency Makefile Fragments 4.4 Inter-Project Dependencies 5 Tutorial: An Example Tool Chain 5.1 Setting up your Environment 5.2 Creating your Plug-in Project 5.3 Creating the Extension 5.4 Adding a Target 5.5 Adding a Configuration 5.6 Adding a Tool 5.7 Testing the Target 5.8 Adding Tool Options 5.9 Taking the Next Step
1 Introduction
C and C++ developers are a diverse group. The tools they use, the processes they follow, and the level of support they expect from their development environments vary widely. The CDT provides a framework for integrating those tools into Eclipse and the managed build system is part of that framework. Understanding how the managed build system works, and what steps are required to extend it is the focus of this document.
A key feature of the managed build system is that it is extensible. Tool integrators can use the grammar, described in Section 2, to add their own tools to the build system. The same grammar is used to save the settings that the user overrides through the UI between sessions.
2.1 Model
The figure below shows a UML model of schema elements.
2.2 Target
In its current implementation, the target in the build model is confusing because it encompasses the responsibilities of two distinct participants in a build. The first is the host target where the build tools are located. The information that this type of target needs to managed are things like the command to start the make utility, to remove files, and to invoke build tools. The second is the physical target that the build artifact is supposed to run on, which may or may not be the same as the host target. This distinction will be clarified in the next iteration of the build model. Targets can be arranged into hierarchies to promote the efficient sharing of tools and configurations. If you have defined a target that should not be selected by the user, but is a root for other targets, it may be declared abstract by setting the isAbstract attribute to true. Abstract targets do not appear in the UI. You must provide a unique identifier for the target in the id attribute. The build model uses this information to distinguish between the target definitions it finds. Children of the abstract target will have the same tools and configurations the abstract target
has. For these children to function properly, their parent attribute must contain the unique identifier of the parent target. A concrete target must have at least one configuration defined for it. A target must also define (or inherit) a set of tool definitions that work together to produce the build goal as an output. You must also provide a meaningful name that will be displayed to the user in the UI and new project wizards. The target defines the command needed to invoke the make utility in the makeCommand attribute. Any special flags that need to be passed to the make utility are defined in the makeFlags attribute. The command to remove files on the host machine is defined in the cleanCommand attribute. Typically a build target will only be valid on a limited subset of operating systems. For example, it does not make much sense to allow a user to create a Solaris shared library project if they are running Eclipse and the CDT on Windows. You can specify the operating systems that the target is restricted to as a comma-separated list in the osList attribute. At the moment, you can specify win32, linux and solaris as the filters. The CDT offers a facility for parsing binary files if it knows which output format the build artifact has been produced with. The binaryParser attribute must contain the id of the appropriate parser if you want build artifacts of the target to be parsed in the workspace. There are currently two defined binary parsers; org.eclipse.cdt.core.PE for Windows artifacts, and org.eclipse.cdt.core.ELF for Linux and Solaris. This information is used to set the parser when a project is created and is not something the user can change through the UI. The target is responsible for maintaining the name of the final build goal. The user selects the name of the build target in the UI, and the build model maintains it in the artifactName attribute. The implementer of a tool chain should not specify this in the plug-in manifest. However, the default extension for the target can be specified using the defaultExtension attribute.
2.2.1 Schema
Attribute artifactName Description Required
The name of the build goal defined by the target. This is set by no the user through the UI and stored in the build model through this attribute. The id of the appropriate parser for the build artifact. The command to remove files on the build machine. You must define this value if the target does not have a parent, or it is not defined in the parent. The extension the build goal will have, for example .exe or .so. A unique identifier that the model manager will use to keep track of this specific target. yes yes
binaryParser cleanCommand
defaultExtension id
no yes
isAbstract
Flags the target as abstract. An abstract target can not be yes selected by the user in the UI, but children of the target will inherit its tools and configurations. A target can be flagged for test purposes only. It can be yes manipulated programmatically, in JUnit tests for example, but not selected by the user in the UI. The command to invoke the make utility. You must define this value if the target does not have a parent, or it is not defined in the parent. yes
isTest
makeCommand
The default flags passed to the make utility on the command line. yes The name for the target that is displayed to the user in the UI. A comma-separated list of operating systems that the target is valid for. The unique ID of the parent of the target. yes no
parent
no
2.2.2 Example
The example below shows a target definition called Executable. Tool and configuration information will be added to our definition is later sections.
2.3 Tool
A tool represents some sort of executable component that can take a set of inputs and produce a set of outputs. A tool must have a unique id for the build model, and a name that is displayed to a user through the UI.
Certain tools logically belong to certain kinds of projects. For example, the Gnu compiler is invoked differently for C and C++ source files. You can specify a filter for a tool based on the nature of a project using the natureFilter attribute. When a new C project is created, a cnature is added to it. New C++ projects have both a cnature and ccnature. The build model interprets the filter as follows. If you specify a cnature filter, then the tool will only be displayed if the project has a cnature and does not have a ccnature. If you specify a ccnature filter, then the tool will be displayed if the project has a ccnature. The default if no filter is specified is to display the tool for all projects. Tools can be added to the plug-in manifest as part of a target or as a stand-alone specification. Tools defined as part of a target will be available for projects that are created to build for the target or any child of the target in which the tool is defined. If you want targets o use a tool that is not specified as belonging to it, you must create a reference to the tool in the target specification. Please refer to section 2.6 for a description of how to use tool references in your plug-in manifest. Tools can define a set of input file extensions in the sources attribute. This indicates that a tool will build for those and only those file types. Similarly, a tool might specify a set of file extensions that they will produce in the outputs attributes. Each tool specifies a command that will be placed in the makefile during the makefile generation stage of building. Two optional flags control how the command is generated. If the tool requires a special output flag, such as -o for a compiler or linker, the implementer must specify that in the outputFlag attribute. If the output of the tool usually has a special prefix, like the prefix lib for libraries on POSIX systems, the implementer must specify this in the outputPrefix attribute. One of the clients of the information in the build model is the makefile generator. It must track the dependencies between elements in the workspace, and to do that, it needs to know if a file is a header or a source file. Currently, the build model uses the list of file extensions specified in the headerExtensions attribute to identify a file as containing an interface.
2.3.1 Schema
Attribute id Description Required
A unique identifier for the tool that will be used by the build yes model. Human-readable name for the tool to be used in the UI. A comma-separated list of file extensions that the tool will produce output for. yes no
name sources
outputs command
The extension that the tool will produce from a given input. no The command that invokes the tool. For example, gcc for the Gnu C compiler, or g++ for the Gnu C++ compiler. yes
outputFlag
An optional flag for tools that allow users to specify a name no for the artifact of the tool. For example, the GCC compiler and linker tools typically allow the user to specify the name of the output with the '-o' flag, whereas the archiver that creates libraries does not. Some tools produce files with a special prefix that must be no specified. For example, a librarian on POSIX systems expects the output to be lib.a so 'lib' would be the prefix. Unused in 1.2 no
outputPrefix
dependencyCalculator headerExtensions
A comma-separated list of file extensions that are used for yes header files by the tool chain. Specify the project natures the tool should apply to. yes
natureFilter
2.3.2 Example
The tool shown in the example below will appear in the UI with the label Compiler. It will be used to build any file in the project with a .C, .cc, or .cpp extension and will produce a file with an .o extension. When the makefile is generated, a rule will be generated with the command g++ <> -o <>.
2.4.1 Schema
Attribute id
Description Used by the build model to uniquely identify the option category.
Required yes
name
A human-readable category name, such as 'Pre-processor yes Options'. This will be the name the user sees displayed in the UI. Option categories can be nested inside other option categories. This is the ID of the owner of the category. yes
owner
2.4.2 Example
This example shows an option category that will be displayed in the UI with the label Flags. There are two options defined in this category, General, and Optimization.
2.5 Configuration
A target defines the information about the tools needed to build a project for a particular environment. Configurations are used to pre-define and store the settings that the user specifies for those tools. A target must have at least one default configuration defined for it. Users can create new configurations for a project, but they must be based on the settings defined in a default configuration. For example, a user may want to create a Profile configuration based on the targets default Debug configuration. Each configuration must have a unique identifier specified in the id attribute that will be used by the build model to manage the configuration. It must also have a name that will be displayed in the UI in the build property page and new project wizards.
2.5.1 Schema
Attribute id
Description
Required
A unique identifier that the model manager will use to keep yes track of this specific configuration. The human-readable name that will be displayed in the UI to identify this configuration. yes
name
2.5.2 Example
The example below shows a configuration named Default that belongs to the target Executable.
2.6.1 Schema
Attribute id Description The unique identifier of the tool this is a reference for. Required yes
2.6.2 Example
The example below shows how the user has overridden the compiler flags option in the compiler tool in the Default configuration.
2.7 Option
Options in the build model are used to organize and maintain the command arguments that are sent to tools during the build. Users interact with the build model through the UI to set the value of options. Options hold different kinds of values, so there are some subtle, yet important, rules for how options are to be defined. These rules are summarized in Table 1 Each option must have a unique id for the build model to properly manage it. A descriptive name that will appear in the UI must be specified. Options can be organized into categories to keep the UI more manageable. If an option category has been defined for the tool, and the option should be displayed as part of that category, then the unique identifier of the option category must be specified in the category attribute.
the contents of the option are treated as the command. For enumerated options, the command associated with the selected enumerated value is used, not the command defined in the option. For Boolean options, the command is used if the option value is set to true, otherwise it is ignored. For list options, the command is applied to each element of the list. Option Value Type string boolean enumerated stringList Uses Default Value Yes Yes No. No. Uses Command No Yes if true, else no No. Yes. UI Element Entry widget Check box Drop-down list-box List and button bar
2.7.4 Schema
Attribute id Description Required
A unique identifier for the tool that will be used by the build yes model. Human-readable name for the tool to be used in the UI. Type of value the option contains. This is the id of the option category for this option. The id can be the id of the tool which is also a category. Optionally specifies the value for the option if the user has not edited it. For options containing a Boolean value, the string true is treated as 1, any other value as 0. An optional value that specifies the actual command that will be passed to the tool on the command line. yes yes no
defaultValue
no
command
no
2.7.5 Example
The example below shows the specification for the optimization level option for a compiler. Note that it is an enumerated type, so the only attributes defined for the option itself are its id for the build model, a human-readable name, the id of the category it belongs to, and the type of value the option holds.
2.8.1 Schema
Attribute id Description Required
The unique identifier of the option that this is a reference to. yes
defaultValue
For boolean and string options, this field is used to hold the no value entered by the user. For enumerated options, it is used to hold the selected enumerated option value. For list options, this attribute is not used. unused in 1.2 no
command
2.8.2 Example
The example below shows how the build model saves overridden option information in the project file. In this case, the tool reference is a linker, and the option references are for linker flags and library paths.
2.9.1 Schema
Attribute builtIn Description An optional Boolean field that tells the build model to treat the value defined as read-only. Required no
value
The contents of the list item. The build model will apply the no flag defined in the option to each value in the list.
2.9.2 Example
The example below shows an option, Defined Symbols, which contains a pre-populated list of built-in values; __I386__, and __i386__ respectively.
2.10.1 Schema
Attribute id Description Required
A unique identifier for the tool that will be used by the build yes model. A descriptive name that will be displayed to the user in the yes UI as one of the option values to select. Flags this enumerated value as the default to apply to the option if the user has not changed the setting. The command that the enumerated value translates to on the command line. no
name
isDefault
command
yes
2.10.2 Example
The option below shows an enumerated option to flag the language dialect for the Gnu preprocessor.
3 UI Representation
In addition to controlling the way a project is built, the build model also defines how the user interface will appear. There are two principle ways a user interacts with the build settings model. The first is at project creation time through the New Project wizards, the second is through the build settings property page.
4 Makefile Generator
The third key element of the managed build system is the makefile generator. The makefile generator is one of the key clients of the information stored in the build settings model. The best way to understand how the makefile generator works is to look at a real project. The figure below shows the project that we will be using for the purposes of this discussion. The source for the project is spread over the directories source1/, source2/, and source2/source21. Header files are located in 2 locations; headers/, and source2/source21.
This makefile is passed as an argument to make, so it contains the real build target, along with clean and all targets. Finally, the makefile generator will calculate dependencies for each of the source files in the build, and generate these into a dependency fragment for each subdirectory. The main makefile includes each of the fragments as well.
The fragment contributes one file, class1.cpp, and a rule to build all source files with the cpp extension. The content of the dependency and command lines is derived from the build settings model. For the dependency line, the makefile generator asks the build model if there are any tools that build files with a particular extension. If so, the tool is asked for the extension of the output. For the command line, the tool that builds for the extension supplies the actual command, while the options for the tool supply the arguments to pass to it.
exe. It references project B which builds a library libB.a. The main build target in the makefile for project A would be generated with the output of project B as a dependency.
As you can see from the generated makefile above, the rule for the target A.exe will be evaluated if the output of B has changed. This works well if the output of project B can be determined. However, that is only the case when project B is managed. Standard make projects do not know what the output of their build step is since that information is encoded in the makefile. If project A references a standard project, it will not have an explicit dependency on the output of that project. The second element of the inter-project dependency is the rule to build the dependent project. This is generated as part of the deps target to ensure that the output of B is up-to-date when A is built. The rule to build the referenced project is simply a command to change to the appropriate build directory of the referenced project and call make again. Note that $(MAKE) will evaluate to the same invocation that was used to build the main project including the flags that were passed to it.
1. Open the New Project... wizard (File > New > Project...), choose Plug-in Project from the Plug-in Development category and click the Next > button. 2. On the Plug-in Project Name page, use org.eclipse.cdt.example.toolchain as the name for your project, and click the Next > button. 3. On the Plug-in Project Structure Page you will see that the wizard has set the id to org.eclipse.cdt. example.toolchain by default. We are going to be defining the tool chain in the plug-in manifest file without writing any code, so choose the Create a simple project radio button and click on the Finish button. 4. If asked if you would like to switch to the Plug-in Development perspective, answer Yes.
define the operating systems that the target should be visible on. Locate the osList property and click it to edit the value. Enter win32 if you are running the tutorial on Windows, linux if you are running on one of the Linux distributions, or solaris if you are running on a version of Solaris.
selection widget. Select it and note that the list of available configurations now contains the single configuration we defined for the target. Click Finish. 5. Right click on your new project in the Navigator or C/C++ Project view to access the context menu, and select Properties to open the property browser for the project. Select C/C++ Build from the choices and note that the tool we defined appears in the list. At this point, you have no doubt noticed that the property page does not have any way to edit the settings for the tool. That is because we have not defined any options yet. It is time to edit the tool chain definition again.
Every compiler relies on having a correct set of preprocessor symbols and header file search paths to perform proper builds. Even compiler from the same vendor may use different symbols and search paths when building for different operating systems. Some of these values may be defined by the user, but others will be built into the tools themselves so the user will be unaware of them. Unfortunately, the CDT parser needs to know about the entire set to properly parse source files. There are two approaches you can take, but both involve pre-populating the include path and defined symbol options with list option values containing the correct information. If you add a value to the include path or symbol option, it will be displayed to the user by default. This may be the right approach to take if you believe that users will change these values frequently. However, it will clutter the UI with values and since they are editable, users may delete them accidentally. The alternative is to flag the list option value as a built-in value. In this case, the user will not be able to edit the values through the UI. This has the advantage of keeping the UI cleaner, but the only way for the user to edit these values if something changes is to directly edit the plug-in manifest where the extension is specified. The CDT team is currently developing a mechanism to specify this information in an extensible way. In the current release however, we are relying on the implementers of a tool chain to supply the default symbols and paths in their specification. Please refer to section 2.9 for more details on specifying list option values.
destination list. Click the Next > button. 2. Make sure that org.eclipse.cdt.example.toolchain is selected in the left-hand list and that only plugin.xml is selected in the right. To select an export destination, click the Browse... button beside the entry widget labelled To directory. Browse to the plugins subdirectory of your Eclipse installation. Click the Finish button. 3. Restart Eclipse, switch to the C/C++ Development Perspective and run the new project wizard to create a new project based on your tool-chain specification.
Debug
This section describes CDT debug concepts. Breakpoints Debug overview Debug information Error Parsing Invoking Make
Breakpoints
A breakpoint suspends the execution of a thread at the location where the breakpoint is set. To set a breakpoint, right-click in the frame on the left side of an editor beside the line where you want the breakpoint, then choose Add Breakpoint. Once set, a breakpoint can be enabled and disabled by right-clicking on its icon or by right-clicking on its description in the Breakpoints view.
q
When a breakpoint is enabled, it causes a thread to suspend whenever it is hit. Enabled breakpoints are indicated with a blue circle. Enabled breakpoints that are successfully installed are indicated with a checkmark overlay. When a breakpoint is disabled, it will not cause threads to suspend. Disabled breakpoints are indicated with a white circle.
Debugging breakpoints are displayed in the marker bar in the editor area and in the Breakpoints view. Note: Execution will also suspend if Stop at main() on startup is enabled on the Launch Configuration dialog. To access the Launch Configuration dialog, from the menu bar choose Run > Debug.
Debug overview
The debugger lets you see what's going on "inside" a program while it executes. In order to debug your application, you must use executables compiled for debugging. These executables contain additional debug information that lets the debugger make direct associations between the source code and the binaries generated from that original source. The CDT debugger uses GDB as the underlying debug engine. It translates each user interface action into a sequence of GDB commands and processes the output from GDB to display the current state of the program being debugged. Tip: Editing the source after compiling causes the line numbering to be out of step because the debug information is tied directly to the source. Similarly, debugging optimized binaries can also cause unexpected jumps in the execution trace.
Debugging
Debug information
The Debug perspective lets you manage the debugging or running of a program in the Workbench. You can control the execution of your program by setting breakpoints, suspending launched programs, stepping through your code, and examining the contents of variables. The Debug perspective displays the following information:
q q q
The stack frame for the suspended threads for each target that you are debugging Each thread in your program represented as a node in the tree The process for each program that you are running
The Debug perspective also drives the C/C++ Editor. As you step through your program, the C/C++ Editor highlights the location of the execution pointer.
Variables
You can view information about the variables in a selected stack frame in the Variables view. When execution stops, the changed values are by default highlighted in red. Like the other debug-related views, the Variables view does not refresh as you run your executable. A refresh occurs when execution stops.
Expressions
An expression is a snippet of code that can be evaluated to produce a result. The context for an expression depends on the particular debug model. Some expressions may need to be evaluated at a specific location in the program so that the variables can be referenced. You can view information about expressions in the Expressions view.
Registers
You can view information about the registers in a selected stack frame. Values that have changed are highlighted in the Registers view when your program stops.
Memory
You can inspect and change your process memory.
Shared libraries
You can view information about the shared libraries loaded in the current debug session.
Signals
You can view the signals defined on the selected debug target and how the debugger handles each one.
Debugging
C/C++ search
You can conduct a fully or partially qualified name search. Further qualifying a search increases the accuracy and relevance of search results. The sections below provide guidance on how to control the scope of your search through the use of search delimiters, correct syntax, and wildcards. You can search for:
q
q q q q
language constructs within: r projects in your workspace r selected resources from various views r working sets a working set for references to particular elements declarations of particular elements definitions of particular elements references of particular elements
For information on working sets, see Workbench User Guide > Concepts > Workbench > Working sets
You can further qualify the search by Class/Struct specifying "class" or "struct" in front of the name that you are searching for. Specifying "class" or "struct" also allows you to search for anonymous classes and structures.
Searches for global functions or functions in a namespace (functions that are not members of a class, struct, or union). Function You can specify parameters to further qualify your search. When specifying a parameter list, everything between the parentheses should be valid C/C++ syntax. Do not specify the return type of the function. Searches for variables that are not members of a class, struct, or union. Searches for unions. Anonymous unions can be searched for by specifying "union" as the search pattern. Searches for methods that are members of a class, struct, or union.
Variable
Union
Method Searching for methods also finds constructors and destructors. See above note for functions. Searches for fields that are members of a class, Field struct, or union. Enumeration Searches for enumerations. Enumerator Searches for enumerators. Namespace Searches for namespaces.
You can control the scope of the search by specifying which of the following is to be searched:
q q q
Wildcard characters
You can use wildcard characters to further refine your search. Use this wildcard character To search for this Any string Tip: Use the character * to search for operators that begin with *. See syntax examples in the table below. A single character Nested elements
? ::
Tip: Do not use wild cards between the brackets of a function or method pattern. For example, the search string f( * ) is an invalid search that results in a search for any function f because the asterisk is interpreted as a pointer rather than a wild card.
Syntax examples
The table below provides syntax examples and an explanation for each example to help you conduct an effective search. Syntax ::*::*::A ::*::*::A? ::A *() *( A * ) Searches for this A nested element two levels deep Any two-letter name that begins with A and is two levels deep Searches for A not nested in anything Any function taking no parameters Any function taking 1 parameter that is a pointer to type A
f( int * )
Will search for function f taking 1 parameter that is an int * Will search for a function f, taking 2 parameters; one is a const char array, the other is a reference to type A Finds only operator * Finds only operator *= Finds all operators Searches for anonymous classes Searches for anonymous structs Searches for anonymous unions
Search results
Search results are displayed in the Search view. You can sort your search by Name, Parent Name and Path. You can also repeat your last search.
Search Concepts
Declarations
According to the ANSI C++ Spec, a declaration is a statement that introduces a name into a translation unit or re-declares a name that has been previously introduced by a previous declaration. All C/C++ search elements can be searched for declarations.
Definitions
Most declarations are also definitions; in other words, they also define the entity for they declare the name for. However there are some elements that can have separate definitions from their declarations.
For C/C++ search the following elements can be searched for definitions:
q q
Functions/Methods the definition is where the code implementation resides Variable: 1. Extern the definition is where the variable is initialized 2. Non extern - the definition of a variable is where it is declared Field: 1. Static fields - the definition of a static field is where it gets initialized 2. Non static fields - the definition corresponds to the fields declaration Namespace the definition of a namespace is the same as its declaration
References
By selecting references, C/C++ search will return all of the places the selected element is used.
All Occurrences
Selecting All Occurrences in the Limit To section will result in a search for declarations, definitions (if applicable) and references for whatever element or elements have been selected.
Any Element
Selecting Any Element in the Search For section will result in a search for all of the listed elements plus macros and typedefs. For more information, see:
q q
Workbench User Guide > Concepts > Views > Search view Workbench User Guide > Tasks > Navigating and finding resources
C/C++ Indexer
The C/C++ indexer uses the parser to create a database of your source and header files that provides the basis for C/C++ search, navigation features and parts of content assist. The indexer runs on a background thread and reacts to resource change events such as:
q q q q
C/C++ project creation/deletion Source files creation/deletion File imports Source file content changes
It is possible to customize the behavior of the indexer through the use of source folders or even turn it off completely. This customizable behavior is available on a per-project basis (i.e. it is possible to have different indexer settings for each project in your workspace).
C/C++ search C/C++ Indexer Problem Reporting C/C++ Indexer Opening or Closing a project C/C++ Indexer Progress Bar
Selection Searching for C/C++ elements Enable/Disable the C/C++ Indexer C/C++ Indexer Problem Reporting C/C++ Indexer - Indexer Timeout Setting Source Folders
Search, C/C++ Preferences window C/C++ search page, Search dialog box C/C++ Project Properties, Managed, Indexer C/C++ Project Properties, Standard, Indexer
Preprocessor Problems
In order for search and search related features to work properly, it is imperative that include paths are set up properly so that the parser can find source files and index them. If you suspect that your search results are lacking, you can turn on the preprocessor problem markers. These will place a marker on the line that has the preprocessor problem. This includes:
q q q q q q
Pound error Inclusion not found Definition not found Invalid macro definition Invalid directive Conditional evaluation error
Semantic Problems
The problem markers can also indicate semantic errors in your code. The errors flagged include:
q q q q q q q
Name not found Invalid overload Invalid using Ambiguous lookup Invalid type Circular inheritance Invalid template
C/C++ search C/C++ Indexer C/C++ Indexer Opening or Closing a project C/C++ Indexer Progress Bar
Selection Searching for C/C++ elements Enable/Disable the C/C++ Indexer C/C++ Indexer Problem Reporting C/C++ Indexer - Indexer Timeout Setting Source Folders
Search, C/C++ Preferences window C/C++ search page, Search dialog box C/C++ Project Properties, Managed, Indexer C/C++ Project Properties, Standard, Indexer
C/C++ search C/C++ Indexer C/C++ Indexer Problem Reporting C/C++ Indexer Progress Bar
Selection Searching for C/C++ elements Enable/Disable the C/C++ Indexer C/C++ Indexer Problem Reporting C/C++ Indexer Indexer Timeout Setting Source Folders
Search, C/C++ Preferences window C/C++ search page, Search dialog box C/C++ Project Properties, Managed, Indexer C/C++ Project Properties, Standard, Indexer
C/C++ search C/C++ Indexer C/C++ Indexer Problem Reporting C/C++ Indexer Opening or Closing a project
Selection Searching for C/C++ elements Enable/Disable the C/C++ Indexer C/C++ Indexer Problem Reporting C/C++ Indexer - Indexer Timeout Setting Source Folders
Search, C/C++ Preferences window C/C++ search page, Search dialog box C/C++ Project Properties, Managed, Indexer C/C++ Project Properties, Standard, Indexer
C/C++ search
Search, C/C++ Preferences window C/C++ search page, Search dialog box
Tasks
Task topics provide step-by-step procedural instructions to help you perform required tasks. Creating a project Working with C/C++ project files Displaying C/C++ file components in the C/C++ Projects view Converting a C or C++ nature for a project Creating a C/C++ file Creating a makefile Hiding files by type in the C/C++ Projects view Converting CDT 1.x Projects Adding Convert to a C/C++ Make Project to the New menu Set Discovery Options Writing code Customizing the C/C++ editor Commenting out code Working with Content Assist Using Content Assist Creating and editing code templates Importing and exporting code templates Shifting lines of code to the right or left Navigating to C/C++ declarations Refactoring Building projects Renaming a project Selecting referenced projects Defining build settings Filtering errors Selecting a binary parser Adding Include paths and symbols Selecting a deployment platform Setting build order Building Manually Removing Build Automatically Autosaving on a build Creating a make target Customizing the Console view Viewing and managing compile errors Jumping to errors Filtering the Tasks view Setting reminders
Running and debugging projects Creating or editing a run/debug configuration Selecting a run or debug configuration Creating a run or debug configuration Selecting an application to run or debug Specifying execution arguments Setting environment variables Defining debug settings Specifying the location of source files Specifying the location of the run configuration Debugging Debugging a program Working with breakpoints and watchpoints Adding breakpoints Adding watchpoints Removing breakpoints and watchpoints Enabling and disabling breakpoints and watchpoints Controlling debug execution Stepping into assembler functions Working with variables Adding expressions Working with registers Working with memory Searching for C/C++ elements Selection Searching for C/C++ elements Searching External Files Enable/Disable the C/C++ Indexer C/C++ Indexer Problem Reporting C/C++ Indexer - Indexer Timeout Setting Source Folders
Creating a project
You can create a standard make or managed make C or C++ project. To create a project: 1. Click File > New > Project.
2. In the New Project wizard, click C or C++. 3. Choose either a Standard Make C++ Project or a Managed Make C++ Project.
4. Click Next. 5. In the Name box, type a name. 6. To specify a different directory in which to save your project, clear the Use Default Location check box, and enter the path in the Location box. 7. For managed make projects, click Next to select a deployment platform. For more information, see Selecting a deployment platform. 8. To create your project, click Finish.
9. If a message box prompts you to switch perspectives, click Yes. 10. Define your project properties. For more information, see Defining project properties.
3. Select the Show file members in Project View check box. 4. Click OK. 5. In the C/C++ Projects view, double-click a file component. The component is highlighted in the C/C++ editor.
The C/C++ Projects view can also be filtered to show certain types of file components. For more information, see Hiding files by type in the C/C++ Projects view.
Hiding files by type in the C/C++ Projects view Searching for C/C++ elements Navigate to C/C++ declarations
2. 3. 4. 5. 6. 7.
Click C or C++. Click Convert to C/C++ Make Project. Click Next. In the Candidates for conversion list, select the projects to convert. In the Convert to C or C++ box, click C Project or C++ Project. Click Finish.
Writing code
Project properties
2. In the list of projects, verify that the correct project is selected. 3. In the File name box, type a name followed by the appropriate extension. 4. Click Finish.
The file will open in the C/C++ editor. 5. Enter your code in the editor view..
Displaying C/C++ file components in the C/C++ Projects view Hiding files by type in the C/C++ Projects view
Project properties
Creating a makefile
If you have created a Standard Make C/C++ Project, you need to provide a makefile. When you build a project, output from make is displayed in the Console view. Makefile actions are displayed in the Make Targets view. To create a makefile: 1. In the C++ Projects view, right-click a project, and select New > File.
2. In the File name box, type makefile. 3. In the list of projects, verify that the correct project is selected. 4. Click Finish.
5. The C/C++ editor opens. Type makefile instructions in the C/C++ editor.
Displaying C/C++ file components in the C/C++ Projects view Hiding files by type in the C/C++ Projects view
Views
2. Click Filters.
3. Select the file types that you want to hide. 4. Click OK. The C/C++ Projects view refreshes automatically.
Displaying C/C++ file components in the C/C++ Projects view Hiding files by type in the C/C++ Projects view
Views
Restart Eclipse
When Eclipse starts, the CDT 1.x project will be detected and you will be prompted to update the project.
From the Convert to C/C++ Make Project Wizard select the project you want to convert and click Finish.
Note: You may need to manually enable Path Discovery for CDT 1.x Standard Make projects, depending on how your CDT project was configured. See Set Discovery Options for details.
Adding Convert to a C/C++ Make Project to the New menu Set Discovery Options
From the Customize Perspecive Wizard select Convert to a C/C++ Make Project and click OK. Note: Ensure New is selected in the Submenus: list.
The File > New > Convert to a C/C++ Make Project option will now be available.
Converting CDT 1.x Projects C/C++ Project Properties, Standard, Discovery Options
Writing code
This sections explains how to work with the C/C++ editor. Customizing the C/C++ editor Commenting out code Working with Content Assist Using Content Assist Creating and editing code templates Importing and exporting code templates Shifting lines of code to the right or left Searching for C/C++ elements Selection Searching for C/C++ elements Navigating to C/C++ declarations Refactoring
4. On the General Page set your preferences and click Apply. For a description of the General preferences click here. 5. To customize the color of the text in the editable area of the C/C++ editor, click the Colors tab.
6. On the Colors page set your preferences and click Apply. For a description of the Color preferences click here. 7. To customize Content Assist preferences, click the Content Assist tab. For more information, see Using Content Assist 8. Click OK.
Coding aids
Code entry
2. Do one of the following: r Continue typing. The list shortens. When there is only one item in the list, it is automatically inserted. r Double-click an item in the list to insert it into your code. r Press Esc to close the Content Assist Window. To set Content Assist preferences: 1. Click Window > Preferences. 2. Expand C/C++, and click C/C++ Editor. 3. Click the Content Assist tab.
4. Do the following: r To change the scope from which Content Assist retrieves its proposals, select either Search current file and included files or Search current project by selecting the appropriate the radio button. r To insert an element when you open Content Assist and it is the only item in the list, select the Insert single proposals automatically check box. r To automatically insert a proposal, if it is the only one found when Content Assist is invoked, select the Enable auto activation checkbox. r To display proposals in alphabetical order, rather than by relevance, select the Present proposals in alphabetical order checkbox. r To change the amount of time Content Assist is permitted to parse proposals enter the value for Content Assist parsing timeout in the text box area. r Enable Auto activation of content assist for ".", "->" or "::" triggers by selecting the appropriate checkboxes. r To change the delay before Content Assist is automatically invoked for the triggers (shown above), enter the new delay in the Auto activation delay text box area. r To change the background color of the Content Assist dialog box, click the color palette button. r To change the foreground color of the Content Assist dialog box, click the color palette button. 5. Click OK.
Content Assist
Creating and editing code templates Importing and exporting code templates
4. Do the following: (if required) r In the Name field, enter a template name. r Select Structure, Global or Function for either C or C++ from the Context drop down list. r In the Description field, enter a description for your new code template. r In the Pattern field, enter the code for your template. r Click Insert Variable to add a variable from the list to the code you have entered in the Pattern box. 5. Click OK. The new code template is now displayed in the list. To edit a code template: 1. Click Window > Preferences. 2. Expand C/C++, and click Code Templates. 3. Click Edit. The New Template dialog box opens.
4. Do the following: r In the Name field, change the template name to create a new template based on the current template. r Select Structure, Global or Function for either C or C++ from the Context drop down list to select where the template will appear. r In the Description field, change the description of the code template to reflect your changes. r In the Pattern field, edit the code. r Click Insert Variable to add a variable from the list to the code you have edited in the Pattern box. 5. Click OK.
Content Assist
To import a code template 1. 2. 3. 4. 5. Click Window > Preferences. Expand C/C++, and click Code Templates. Click Import. Select the template file that you want to import. Click OK. The code template list is updated to include the template that you imported.
To export a code template 1. Click Window > Preferences. 2. Expand C/C++, and click Code Templates.
3. Select the templates that you want to export and click the Export... or Export All... button. The Exporting x dialog opens where x is the number of code templates that you are exporting. 4. In File name box, type the path where you want your code templates file to be saved. 5. Click Save. The templates.xml file containing the code templates you exported is saved in your file system.
Content Assist
Code entry
Refactoring
Use the C/C++ Projects, Outline, or the Editor view Refactor > Rename context menu to refactor class & type names, methods, function & member names. To refactor an object select the object, right click and select Refactor > Rename...
The refactoring engine will rename all instances of the object in all referenced files. You can Undo refactoring by right clicking a second time and selecting Refactor > Undo
Building projects
This sections explains how to build your project and manage compile errors. Renaming a project Selecting referenced projects Defining build settings Filtering errors Selecting a binary parser Adding Include paths and symbols Selecting a deployment platform Setting build order Building Manually Removing Build Automatically Autosaving on a build Creating a make target Customizing the Console view Viewing and managing compile errors Jumping to errors Filtering the Tasks view Setting reminders
Renaming a project
You can rename a project, and have all references changed using the refactoring engine. To rename a project: 1. In the C/C++ Projects view, right-click a project, and select Rename.
Note: Renaming a project causes it to be re-indexed. This can take a significant amount of time for very large projects.
Project properties
2. On the left, select Project References from the list. 3. In the Project references... list, select referenced projects..
4. Click OK.
Project properties
Configure how the CDT handles make errors. Change the default build command. Map the target passed to make when you select build or rebuild.
You can define the properties on a per project basis in the New Project wizard, in the C/C++ Projects view or in the Navigator view. You can also define project properties in the Preferences window for future standard make projects. Before you begin In order to be able to turn on or to turn off the feature that automatically performs an incremental build of your project every time a resource is saved for individual projects, you need to enable the Workbench Build Automatically preference. You can then disable this feature or change the associated make target for individual projects. To enable build on resource save: 1. Click Window > Preferences. 2. To automatically perform an incremental build of your project every time a resource is saved, select Workbench from the list. 3. Select the Perform build automatically on resource modification check box. Note: this is the default setting. You can now enable or disable this feature on a per project basis. To define build settings:
1. Do one of the following: r Click Window > Preferences. Expand C/C++, click New Make Projects. r In the C/C++ Projects view, right-click a standard make project, and select Properties. Select C/C++ Make Project from the list. 2. Click the Make Builder tab. 3. Do one of the following: r To stop the build when an error is encountered, select Stop on first build error. 4. Select one of the following build command settings: r To use the default make command, select the Use Default check box. r To use a build utility other than the default make command Build Command box, clear the Use Default check box . 5. In the Workbench Build Behavior box, do the following: r To build your project when resources are saved and change the default make build target, select the Build on resource save (Auto Build) check box. Enter a new build target in the Make build target box. r To change the build default make build target, select the Build (Incremental Build) check box. Enter a new build target in the Make build target box. r To change the rebuild default make build target, select the Rebuild (Full Build) check box. Enter a new build
Filtering errors
The Error Parsers page of the Properties window lists a set of filters that detect error patterns in the build output log. If an error or warning is detected, an icon appears on the file in the Tasks view. If the file is not found, the icon appears on the project. You can define the properties on a per project basis in the New Project wizard, in the C/C++ Projects view or in the Navigator view. You can also define project properties in the Preferences window for future standard make projects. To select error parsers: 1. Do one of the following: r To set properties for future Standard Make projects, click Window > Preferences . ExpandC/C++, and click New Make Projects. r In the C/C++ Projects view, right-click a standard make project, and select Properties. Select C/C++ Make Project from the list. 2. Click the Error Parsers tab. 3. In the Error parsers list, select error parsers. 4. Click OK.
3. In the Binary Parser list, click: r Elf Parser, if you are a Solaris, UNIX, or Linux user. r PE Windows Parser, if you are a Windows user. r Cygwin PE Parser, if you are using Cygwin. 4. Click OK.
and enter your path. 5. Select the container and click Edit to change the order in which your new path or symbol is used.
6. Select the new object and click Up or Down to move it higher or lower in the order, or you can disable it by clicking Disable. 7. Click Finish to close the Edit Container window. 8. Click OK to close the Preferences window.
3. Clear the Use default build order checkbox. 4. Select a project in the list. 5. Do one of the following: r Click Up to move the project up the list. r Click Down to move the project down the list. 6. 7. 8. 9. To add projects to the build path, click Add Project. Select the projects to add to the build order list. Click OK. To remove a project from the Project build order list, click Remove Project. When building or rebuilding all projects, the projects that have been removed from the build order are built last.
Build overview
Building Manually
Manual builds let you choose the scope of a build, as well as options for building, or rebuilding projects. You can view the output of the make utility in the console.
Incremental Builds To incrementally build all open projects, you can select Project > Build All or type CTRL+B. Build Individual Projects To build individual projects click Project > Build Project. Rebuild Projects To rebuild a project right click on the project and select Rebuild Project. Note: This will rebuild projects that this project references as well, but will not rebuild projects that references this one. Build Automatically This performs a Build All whenever any project file is saved, such as your makefile. Tip: For C/C++ projects this feature should be turned off, if there is a checkmark beside Build Automatically it is on, to turn it off select Build Automatically. Tip: If you get the error message: Exec error:Launching failed The error message means that the CDT cannot locate the build command, (usually make). Either your path is not configured correctly or you do not have make installed on your system. Tip: The menubar item Project > Build Working Set submenu for C/C++ projects simply creates a link to the build all target as defined in your makefile, and is no different from an Incremental Build.
Build overview
Build overview
Autosaving on a build
You can let the CDT save modified files whenever you perform a manual build. The files are saved before the build is performed so that the latest version of your files is built. You can view the output of the make utility in the Console view. To save resources before manual builds: 1. Click Window > Preferences. 2. Select Workbench from the list.
3. On the Workbench page, select the Save automatically before build check box. 4. Click OK. The CDT will now save your resources when you build a project.
Build overview
2. Enter the Target name and build options and click Create.
Build overview
3. To display information on the latest build only, select the Always clear console before building check box. 4. To open the Console view when a project is built, select the Open console when building check box. 5. To display the console if it is already open when a project is built, select the Bring the console to top when building (if present) check box. 6. To change the number of lines the console stores in its history, enter a new value in the text field
next to Limit console output (# lines). 7. To change the number of spaces displayed by a tab, enter the number in the txt field next to Display tab width. 8. Click OK.
Build overview
Views
Jumping to errors
The CDT will parse the output from the make and compiler/linker. If the CDT can determine the location of an error, it is added to the Console view. To jump to the source of an error: In the Console view, double-click the Error icon or the Warning icon . The file opens in the C/C++ editor and the cursor moves to the line with the error.
Build overview
1. In Problems view, click the Filters icon . 2. To view all errors and warnings, select all checkboxes in the Show items of type list, and click On any resource. 3. Click OK.
Build overview
Setting reminders
The Tasks view lets you create your own tasks. In addition to having the Tasks view automatically list build errors, you can set personal reminders for tasks, such as unfinished functions that you write or error handling routines that you want to verify. To set a reminder: 1. In Tasks view, right-click the Tasks pane, and select New Task. 2. In the Description box, type a new task. 3. Click OK. For more information on the Tasks view, see:
q q
Workbench User Guide > Concepts> Views > Tasks view Workbench User Guide > Reference > User interface information > Views and editors > Tasks view
Build overview
Selecting a run or debug configuration Creating a run or debug configuration Selecting an application to run or debug Specifying execution arguments Setting environment variables Defining debug settings Specifying the location of source files Specifying the location of the run configuration
5. To change the default name of the new run/debug configuration, see Selecting an application to run or debug.
6. Do the following: r In the Name box, type a descriptive name for this new a descriptive name for this launch configuration. r In the Project box, type the name of the project containing the application that you want to run. r In the C/C++ Application box, type the name of the executable that you want to run. 7. Click Run or do the following, as required: r To specify the execution arguments that an application uses, and to specify the working directory for a run configuration, see Specifying execution arguments. r To set the environment variables and values to use when an application runs, see Setting environment
r r
variables To select a debugger to use when debugging an application, see Selecting a debugger To specify the location of source files used when debugging a C or C++ application, see Specifying the location of source files To specify where the run configuration is stored, how you access it and the perspective to open when running an application, see Specifying the location of the run configuration
6. In the C/C++ Program Arguments box, type the arguments that you want to pass to the command line. 7. To specify a local directory or a different project in your workspace, clear the Use default working directory check box. 8. Click Run or do the following, as required: r To set the environment variables and values to use when an application runs, see Setting environment variables r To select a debugger to use when debugging an application, see Creating a run configuration r To specify the location of source files used when debugging a C or C++ application, see Specifying the location of source files r To specify where the run configuration is stored, how you access it and the perspective to open when running an application, see Specifying the location of the run configuration
6. Do one of the following: r To create a new environment variable, click New. r To import an environment variable, click Import. r To edit an existing environment variable, select an item from the list and click Edit. r To remove an existing environment variable, select an item from the list and click Remove. 7. Type a name in the Name box. 8. Type a value in the Value box. 9. Click Run or do the following, as required: r To specify the execution arguments that an application uses and to specify the working directory for a run configuration, see Specifying execution arguments.
r r
To select a debugger to use when debugging an application, see Selecting a debugger To specify the location of source files used when debugging a C or C++ application, see Specifying the location of source files To specify where the run configuration is stored, how you access it, and the perspective to open when running an application, see Specifying the location of the run configuration
6. 7. 8. 9. 10.
Select a debugger from the Debugger list. To be prompted to select a process from a list at run-time, select Attach to running process. To let your program run until you interrupt it manually, or until it hits a breakpoint, clear the Stop at main() on startup check box . Specify debug options in the Debugger Options box. Click Run or do the following, as required: r To specify the execution arguments that an application uses and the working directory for a run configuration, see Specifying execution arguments. r To set the environment variables and the values to use when an application runs, see Setting environment variables r To specify the location of source files used when debugging a C or C++ application, see Specifying the location of source files r To specify where the run configuration is stored, how you access it, and the perspective to open when running an application, see Specifying the location of the run configuration
5. To save .launch to a project in your workspace, and to be able to commit it to CVS, click Shared. 6. In the Folder Selection window, select a project, and click OK.
7. To specify which perspective opens when you run, select a perspective from the Run mode list. 8. To specify which perspective opens when you run, select a perspective from the Debug mode list. 9. Click Run, or do the following, as required: r To set the environment variables and values to use when an application runs, see Setting environment variables. r To select a debugger to use when debugging an application, see Defining debug settings. r To specify the location of source files used when debugging a C or C++ application, see Specifying the location of source files. r To specify where the run configuration is stored, how you access it, and the perspective to open when running an application, see Selecting a run/debug configuration.
Debugging
This section explains how to debug your project. Debugging a program Working with breakpoints and watchpoints Adding breakpoints Adding watchpoints Removing breakpoints and watchpoints Enabling and disabling breakpoints and watchpoints Controlling debug execution Stepping into assembler functions Working with variables Adding expressions Working with registers Working with memory
Debugging a program
You must create a debug launch configuration the first time you debug your program. To create a debug configuration: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. In C/C++ Projects view, select a project. Click Run > Debug. In the Debug dialog box, select a debug configuration type from the Configurations list. Click New. In the Name box, type a descriptive name for this debug configuration. In the Project box, type the name of the project containing the application you want to debug. In the C/C++ Application box, type the name of the executable that you want to run. Click the Debugger tab. Select Run program in debugger. Select the Stop at main() on startup checkbox. Click Debug. The debug perspective is opened and the application window opens on top. The C/C++ editor window is repositioned in the perspective. For more information:
q
q q
To specify the execution arguments an application uses and the working directory for a run configuration, see Specifying execution arguments. To set the environment variables and values to use when an application runs, see Setting environment variables To select a debugger to use when debugging an application, see Selecting a debugger To specify the location of source files used when debugging a C or C++ application, see Specifying the location of source files To specify where the run configuration is stored, how you access it and what perspective to open when running an application, see Specifying the location of the run configuration
To use a debug configuration: You can reuse a previously created debug launch configuration to debug your program. 1. Click Run > Debug. 2. In the Debug dialog box, select a debug configuration from the Configurations list. 3. Click Debug.
Debug overview
Debug information
Debugging
Adding breakpoints
A breakpoint is set on an executable line of a program. If the breakpoint is enabled when you debug, the execution suspends before that line of code executes. To add a breakpoint point, double click the marker bar located in the left margin of the C/C++ Editor beside the line of code where you want to add a breakpoint. A dot the Breakpoints view, along with the name of the associated file. is displayed in the marker bar and in
For more information on marker bar icons, see Workbench User Guide > Reference > User interface information > Icons and buttons > Editor area marker bar.
Adding watchpoints
A watchpoint is a special breakpoint that stops the execution of an application whenever the value of a given expression changes, without specifying where this may happen. Unlike breakpoints which are linespecific watchpoints are associated with files. They take effect whenever a specified condition is true regardless of when or where it occurred. To add a watchpoint: 1. Click Run > Add C/C++ Watchpoint. 1. If Add C/C++ Watchpoint is not listed on the Run menu, select Window > Customize Perspective. 2. In the Customize Perspective dialog box, expand Other in the Available Items list. 3. Select the C/C++ Debug check box. Click OK. 2. In the Add C/C++ Watchpoint dialog box, type an expression in the Expression to watch box. The expression may be anything that can be evaluated inside an if statement. 3. Do any of the following: r To stop execution when the watch expression is read, select the Read check box. r To stop execution when the watch expression is written to, select the Write check box. 4. In the C/C++ editor, open the file that you added the watchpoint to. 5. Click OK. 6. The watchpoint appears in the Breakpoints view list.
Debugging
In the Debug view, right-click, and select Disassembly Mode. As you step Into assembler functions, the execution trace is displayed in the Assembly Editor.
Debugging
Debug views
To change a variable value while debugging: During a debug, you can change the value of a variable to test how your program handles a particular value or to speed through a loop. 1. In Variables view, right-click a variable, and select Change Variable Value. 2. Type a value. To disable a variable value while debugging: You can disable a variable so that the debugger does not read the variable's value from the target. This is useful if the target is very sensitive or the variable is specified as volatile.
q
Debugging
Debug views
Adding expressions
You can add and view expressions in the Expressions view. The Expressions view is part of the Debug perspective. To add an expression: 1. Click Run > Add Expression. 2. Type the expression that you want to evaluate. For example, (x-5)*3 ). 3. Click OK. The expression and its value appear in the Expressions view. When the execution of a program is suspended, all expressions are reevaluated and changed values are highlighted.
Debugging
Debug views
Debugging
Debug views
You can configure your output to display hexadecimal or decimal. You can also set the number of display columns and the memory unit size. You can configure each memory tab independently. You can customize the Memory view to colors and fonts displayed. You can also customize some of its behavior. The customizations affect the entire Memory view. To change process memory: Warning: Changing process memory can cause a program to crash. 1. In the Debug view, select a process. Selecting a thread automatically selects the associated process. 2. In the Memory view, click a memory tab. 3. Do one of the following: r In the Address box, type an address and press Enter. r In the memory view, type a new value for memory. The Memory view works in "typeover" mode. To jump from byte to byte use the arrow keys:
To change the appearance of the Memory view: 1. Do one of the following: r In the Memory view, click one of the tabs. r Click Window > Preferences. 2. In list of memory addresses, right-click, and select: r Format > Hexadecimal, Signed Decimal or Unsigned Decimal. r Memory Unit Size > 1, 2, 4, or 8 bytes r Number of Columns > 1, 2, 4, 8, or 16 columns.
Debugging
Debug views
What you can search for How to limit your search How to use wildcard characters in your search Syntax examples
Performing a C/C++ Search can be done in a number of different ways but regardless of the manner chosen the same information must be provided to C/C++ Search. The info required to do a search is: Search string this is the name of the element you are looking for. See C/C++ search for more information on how to specify wildcard searches and how to further refine your searches by using fully qualified names Search For Limit To this is the element type that you wish to search for. You can also select to search on Any Element which will perform the search on a combination of all elements this allows you to limit your search to declarations, definitions or references. You can also select All Occurrences which will search for declarations, definitions and references that match the element this allows the user to limit the scope of the search. The three available scopes are: Workspace this searches all of the open projects in the workspace Selected Resources this option becomes enabled whenever something is selected in one of the following views in the C/C++ perspective: q C/C++ Projects q Navigator q Search q Outline The scope will be limited to whatever element is selected in the view. Working Set working sets can be selected and created
Scope
q q q
Using the C/C++ Search dialog Selecting an element in the Editor view Selecting an element in the C/C++ Projects view or Selecting an element from the Outline view
1. Enter the search string in the Search String field (optional mark it case sensitive). Note: that previous search queries (from the same work session) are remembered and can be accessed via the drop down list. 2. Select the Search For element. 3. Select the Limit To. 4. Select the Scope. 5. Press Search. Results are displayed in the Search view.
1. Select the desired element in the editor. 2. Right click and select All Declarations or All References and the scope you wish to search. Results are displayed in the Search view.
Workbench User Guide > Concepts > Views > Search view Workbench User Guide > Concepts > Workbench > Working Set Workbench User Guide > Tasks > Navigating and finding resources
What you can search for How to limit your search How to use wildcard characters in your search Syntax examples
To search for an element in your project: 1. Highlight the element you want to search. 2. Right click and select Search For from the context menu.
Workbench User Guide > Concepts > Views > Search view Workbench User Guide > Tasks > Navigating and finding resources
The indexer can be enabled or disabled at any time by: 1. 2. 3. 4. Right clicking on the project Selecting Properties Navigate to the C/C++ Indexer page Select/Deselect the Enable C/C++ Indexing checkbox.
If you enable the index on a project that had the index disabled, the indexer will reindex all of the projects source folders. If you disable the index on a project, it will no longer react to any resource change events. If the indexer is indexing at the time you disable the index, it will throw away the rest of the index jobs at that point. If some projects in your workspace have the indexer disabled, then search will display a warning message in the status bar. If all projects have the index disabled then Search will not allow you to continue until at least one project has the index enabled. You can also disable the indexer when you first create a new project by clicking on the C/C++ Indexer tab (which is present in both Standard and Managed project wizards) and deselecting the Enable C/C++ Indexing checkbox.
C/C++ search C/C++ Indexer C/C++ Indexer Problem Reporting C/C++ Indexer Opening or Closing a project C/C++ Indexer Progress Bar
Selection Searching for C/C++ elements C/C++ Indexer Problem Reporting C/C++ Indexer - Indexer Timeout Setting Source Folders
Search, C/C++ Preferences window C/C++ search page, Search dialog box C/C++ Project Properties, Managed, Indexer C/C++ Project Properties, Standard, Indexer
To enable C/C++ Index Problem reporting: 1. Right click on the project and select Properties > C/C++ Indexer 2. Select the Enable C/C++ Index problem reporting checkbox 3. Click OK
C/C++ search C/C++ Indexer C/C++ Indexer Problem Reporting C/C++ Indexer Opening or Closing a project C/C++ Indexer Progress Bar
Selection Searching for C/C++ elements Enable/Disable the C/C++ Indexer C/C++ Indexer - Indexer Timeout Setting Source Folders
Search, C/C++ Preferences window C/C++ search page, Search dialog box C/C++ Project Properties, Managed, Indexer C/C++ Project Properties, Standard, Indexer
This can be set as follows: 1. Click Windows > Preferences > C/C++ > Search 2. Enter the timeout value in milliseconds into the text field. 3. Click OK
C/C++ search C/C++ Indexer C/C++ Indexer Problem Reporting C/C++ Indexer Opening or Closing a project C/C++ Indexer Progress Bar
Selection Searching for C/C++ elements Enable/Disable the C/C++ Indexer C/C++ Indexer Problem Reporting Setting Source Folders
Search, C/C++ Preferences window C/C++ search page, Search dialog box C/C++ Project Properties, Managed, Indexer C/C++ Project Properties, Standard, Indexer
To setup source folders: 1. Right click on the project and select Properties > C/C++ Project Paths 2. Click on the Source tab By default the entire project is a source folder, which means everything will be indexed. This is reasonable for smaller projects but definitely not recommended for large projects. 3. Click Add folder to add the folders. A dialog will explain exclusion filters have been added to nesting folders. You will see that the folder you added will be excluded from the project folder (in order to avoid including a folder twice). Repeat until all the folders have been added. Note: Don't forget to remove the project folder (which appears by default) otherwise everything will be indexed. 4. Click OK. Your view in C/C++ projects will now change. You should see your source folders designated with a "C" and all other source and header files icons that are in a non-source folder will change to a "hollow" C or H.
C/C++ search C/C++ Indexer C/C++ Indexer Problem Reporting C/C++ Indexer Opening or Closing a project C/C++ Indexer Progress Bar
Selection Searching for C/C++ elements Enable/Disable the C/C++ Indexer C/C++ Indexer Problem Reporting C/C++ Indexer - Indexer Timeout
Search, C/C++ Preferences window C/C++ search page, Search dialog box C/C++ Project Properties, Managed, Indexer C/C++ Project Properties, Standard, Indexer
Reference
This section describes the Views, Windows and Dialog Boxes available from the C/C++ perspective. C/C++ Views and Editors Selecting Views and Editors C/C++ Projects view Navigator view Outline view Make Targets view Editor view Console view Problems view Properties view Search view Debug views Registers view Memory view Memory view preferences Shared libraries view Signals view Debug view Debug preferences C/C++ Icons C/C++ Menubar File Menu actions Edit Menu actions Navigate Menu actions Search Menu actions Project Menu actions Run Menu actions Window Menu actions C/C++ Toolbar C/C++ Open Type Create a Make Target C/C++ Find/Replace C/C++ preferences Build Console preferences Code Templates preferences Debug preferences GDB MI preferences Source Code Locations preferences
C/C++ Editor preferences General preferences Color preferences Content Assist preferences Hover preferences Navigation preferences File Types preferences Make Targets preferences New Make Projects properties preferences Make Builder preferences Error Parser preferences Binary Parser preferences Discovery Options preferences Search preferences C/C++ Project Properties Managed Make Projects Info Builders Build File Types Indexer Error Parser Binary Parser Project References Standard Make Projects Info Builders File Types Include Paths and Symbols Indexer Make Project Make Builder Error Parser Binary Parser Discovery Options Project Paths Source Output Projects Libraries Path Containers Project References C/C++ New Project Wizard
Managed Make Projects Name Select a Target Referenced Projects Error Parsers C/C++ Indexer Standard Make Projects Name Referenced Projects Make Builder Error Parsers Binary Parser Discovery Options C/C++ Indexer C/C++ Run and Debug Main Arguments Environment Debugger Source Common C/C++ search
Basic views
Console Displays the application's output. Navigator Displays the file system under the launchdir/workspace directory. Outline Displays the functions and header files in your source files. Open a source file in an editor to view its outline. Problems Displays problems. Properties
Displays the name, path, size, permissions, and last modified date of the resource highlighted in the Navigator view. Search Displays the results of file or text searches.
C views
C/C++ Projects Displays your current projects. This is similar to the Navigator view, except that: r Only projects and their contents are displayed r You are able to view the "building blocks" of the files, such as the include files and the functions.
Make views
Make Targets Lists your projects. To build a project, double-click on it..
Editor view
The Editor view is not listed under Window > Show View or Window > Show View > Others, it is opened whenever an editable file is opened from the C/C++ Projects or Navigator views.
Browse the elements of C/C++ source files Open files in the editor view Open projects in a new window Create new projects, classes, files, or folders Manage existing files (cut, paste, delete, move or rename) Restore deleted files from local history Import or Export files and projects
Files that you select in the C/C++ Projects view affect the information that is displayed in other views.
Toolbar
Icon Name MinimizeConsole Minimizes the Console view. Description
Back
This command displays the hierarchy that was displayed immediately prior to the current display. For example, if you Go Into a resource, then the Back command in the resulting display returns the view to the same hierarchy from which you activated the Go Into command. The hover help for this button tells you where it will take you. This command is similar to the Back button in a web browser. This command displays the hierarchy that was displayed immediately after the current display. For example, if you've just selected the Back command, then selecting the Forward command in the resulting display returns the view to the same hierarchy from which you activated the Back command. The hover help for this button tells you where it will take you. This command is similar to the Forward button in a web browser. This command displays the hierarchy of the parent of the current highest level resource. The hover help for this button tells you where it will take you. This command collapses the tree expansion state of all resources in the view. This command toggles whether the Navigator view selection is linked to the active editor. When this option is selected, changing the active editor will automatically update the Navigator selection to the resource being edited. Click the black upside-down triangle icon to open a menu of items specific to the Navigator view. Select Working Set Opens the Select Working Set dialog to allow selecting a working set for the Navigator view. Deselect Working Set Deselects the current working set. Edit Active Working Set Opens the Edit Working Set dialog to allow changing the current working set. Sort This command sorts the resources in the Navigator view according to the selected schema: r By Name: Resources are sorted alphabetically, according to the full name of the resource (e.g., A.TXT, then B.DOC, then C. HTML, etc.) r By Type: Resources are sorted alphabetically by file type/ extension (e.g., all DOC files, then all HTML files, then all TXT files, etc.). Filters This command allows you to select filters to apply to the view so that
Forward
Menu
you can show or hide various resources as needed. File types selected in the list will not be shown in the Navigator. Link with Editor See the toolbar item description above.
Displaying C/C++ file components in the C/C++ Projects view Hiding files by type in the C/C++ Projects view
Navigator view
This view provides a hierarchical view of the resources in the Workbench.
Toolbar
Icon Name MinimizeConsole Minimizes the Console view. Description
Maximize Console Maximizes the Console view. Back This command displays the hierarchy that was displayed immediately prior to the current display. For example, if you Go Into a resource, then the Back command in the resulting display returns the view to the same hierarchy from which you activated the Go Into command. The hover help for this button tells you where it will take you. This command is similar to the Back button in a web browser. This command displays the hierarchy that was displayed immediately after the current display. For example, if you've just selected the Back command, then selecting the Forward command in the resulting display returns the view to the same hierarchy from which you activated the Back command. The hover help for this button tells you where it will take you. This command is similar to the Forward button in a web browser. This command displays the hierarchy of the parent of the current highest level resource. The hover help for this button tells you where it will take you.
Forward
Up
This command collapses the tree expansion state of all resources in the view. This command toggles whether the Navigator view selection is linked to the active editor. When this option is selected, changing the active editor will automatically update the Navigator selection to the resource being edited. Click the black upside-down triangle icon to open a menu of items specific to the Navigator view. Select Working Set Opens the Select Working Set dialog to allow selecting a working set for the Navigator view. Deselect Working Set Deselects the current working set. Edit Active Working Set Opens the Edit Working Set dialog to allow changing the current working set. Sort This command sorts the resources in the Navigator view according to the selected schema: r By Name: Resources are sorted alphabetically, according to the full name of the resource (e.g., A.TXT, then B.DOC, then C. HTML, etc.) r By Type: Resources are sorted alphabetically by file type/ extension (e.g., all DOC files, then all HTML files, then all TXT files, etc.). Filters This command allows you to select filters to apply to the view so that you can show or hide various resources as needed. File types selected in the list will not be shown in the Navigator. Link with Editor See the toolbar item description above.
Menu
In addition to these menu items, the Navigator view menu shows a list of recently used working sets that have been selected in the view.
Outline view
The Outline view displays an outline of a structured C/C++ file that is currently open in the editor area, by listing the structural elements.
Variable Field private Field protected Field public Include Method private Method protected Method public Struct Type definition Union Function
Outline view
Views
Description Move to the top level. Navigates back to a previous level. Navigates forward to the next level.
Editor view
The C/C++ editor provides specialized features for editing C/C++ related files.
Associated with the editor is a C/C++-specific Outline view, which shows the structure of the active C, C++ or makefile. It is updated as you edit these files. The editor includes the following features:
q q q
The most common way to invoke the C/C++ editor is to open a file from the Navigator or the C/C++ Project views using pop-up menus or by clicking the file (single or double-click depending on the user preferences). The C/C++ editor does not contain a toolbar itself, but relies on the use of the main toolbar, edit menu, search menu and key binding actions.
Console view
This view shows the output of the execution of your program and enables you to enter input for the program.
The console shows three different kinds of text, each in a different color:
q q q
You can choose the different colors for these kinds of text on the preferences pages (Window > Preferences > Debug > Console).
Remove all Terminated Launches Removes all terminated launches that are associated with the console. Scroll Lock Clear Console Pin Console Display Selected Console MinimizeConsole Maximize Console Toggles the Scroll Lock. Clears the console. Forces the Console view to remain on top of other views in the window area. If multiple consoles are open, you can select the one to display from a list. Minimizes the Console view. Maximizes the Console view.
Problems view
If you encounter any errors during a build they will be displayed in the Problems view.
Errors are passed up from your C++ compiler. The Problems view lists the error, filename and folder. If you select an error the associated file will open in the C/C++ Editor view and the cursor will display the line where the error was encountered.
Deletes the selected error from the Problems view. Lauches the Filter dialog box to filter the errors in the problems view. Select the Sort or Filters help navigate through errors in the Problems view. Minimizes the Problems view.
Properties view
The properties view displays property names and values for a selected item such as a resource.
Toolbar buttons allow you to toggle to display properties by category or to filter advanced properties. Another toolbar button allows you to restore the selected property to its default value. To see more detailed information about a resource than the Properties view gives you, right-click the resource name in the Navigator view and select Properties from the pop-up menu.
Toolbar
Icon Name Show Categories Description This command, when selected, lists the properties in sorted categories.
Show Advanced Properties This command, when selected, shows advanced properties. By default, advanced properties are filtered. Restore Default This command returns any modified properties to their default values.
Menu
Click the black upside-down triangle icon to open a menu of items specific to the Properties view. Show Categories See the toolbar item description above. Show Advanced Properties See the toolbar item description above.
Search view
Any matches are reported in the Search view.
When you have completed a search and have results in the Search view, you can put the focus on that view and get more options on the Search menu. A C/C++ search can also be conducted via the context menu of selected resources and elements in the following views:
q q q q q
C/C++ Projects Make Targets Navigator Outline view Search result view
The search context menu is also available in the C/C++ editor. The search is only performed if the currently selected text can be resolved to a C/C++ element. The type of the selected C/C++ element defines which search context menus are available. The C/C++ editor does not constrain the list of available C/C++ searches based on the selection.
Remove the Selected Matches Removes user selected matches from the search console. Remove All Matches Clears the search console.
Terminates the current search. Shows the list of previously run searches which can be reselected. Lists two selectable view layouts for search results: Flat and Heirarchical. Minimizes the Console view. Maximizes the Console view.
Debug views
This section describes debug views. Registers view Memory view Memory view preferences Shared libraries view Signals view Debug view Debug preferences
Registers view
The Registers view of the Debug perspective lists information about the registers in a selected stack frame. Values that have changed are highlighted in the Registers view when your program stops. The options described below are available when you right-click a register value. Change Register Value Specifies a register value. Format Displays register values, in Natural, Decimal, or Hexadecimal number systems. Show Type Names Displays the type, (such as int) beside each register value. Auto-Refresh Updates the registers list each time execution stops. Refresh Updates the registers list. Display as Array Displays a selected register as an array of a specified length and index. This option is only applicable to pointers. Cast To Type Casts a register value to a different type. Restore to Original Type Restores a register value to its original type.
Debug information
Views
Memory view
The Memory view of the Debug perspective lets you inspect and change your process memory. The view consists of four tabs that let you inspect multiple sections of memory. The options described below are available when you right-click a memory value. Auto-Refresh Updates the memory address list each time execution stops. Refresh Updates the memory address list. Clear Clears the selected memory address. Format Specifies the number system in which to display memory values (Hexadecimal, Signed Decimal, or Unsigned Decimal). Memory Unit Size Specifies the memory address size (1 byte, 2 bytes, 4 bytes, 8 bytes). Number of Columns Specifies the numbers of columns displayed in the Registers view (1 column, 2 columns, 4 columns, 8 columns, 16 columns). Show ASCII Displays the selected value as ASCII. Detail panel Displays the raw output from GDB for the selected variable.
Debug information
Views
Debug information
Views
Debug information
Debugging
Views
Signals view
The Signals view of the Debug perspective lets you view the signals defined on the selected debug target and how the debugger handles each one. Name Displays the name of the signal. Pass Where "yes" is displayed, the debugger lets your program see the signal. Your program can handle the signal, or else it may terminate if the signal is fatal and not handled. Suspend Where "yes" is displayed, the debugger suspends your program when this signal is handled. Description Displays a description of the signal.
Debug information
Debugging
Views
Debug view
The Debug view shows the target information in a tree hierarchy shown below with a sample of the possible icons: Session item Launch instance Debugger instance Thread instance Stack frame instance Description Launch configuration name and launch type Debugger name and state Thread number and state Stack frame number, function, file name, and file line number Icons
The number beside the thread label is a reference counter, not a thread identification number (TID). The CDT displays stack frames as child elements. It displays the reason for the suspension beside the target, (such as end of stepping range, breakpoint hit, and signal received). When a program exits, the exit code is displayed. In addition to controlling the individual stepping of your programs, you can also control the debug session. You can perform actions such as terminating the session and stopping the program by using the debug launch controls available from Debug view. Action Terminate Disconnect Remove All Terminated Terminate and Remove Relaunch Terminate All Icon Description Ends the selected process Detaches the debugger from the selected process (useful for debugging attached processes) Clears all the killed processes in Debug view Ends the selected process and remove it from Debug view Restarts the process Ends all active processes in Debug view
Debugging
Debug preferences
The Debug view of the Debug perspective displays information about the variables in the currently selected stack frame. Show full paths Displays the full path of resources Default variable format Specifies the number system in which to display variables (Natural, Hexadecimal or Decimal). Default expression format Specifies the number system in which to display expressions (Natural, Hexadecimal or Decimal). Default register format Specifies the number system in which to display registers (Natural, Hexadecimal or Decimal). Automatically switch to disassembly mode Automatically examines your program in disassembly mode as it steps into functions for which you do not have source code, such as printf().
Debug information
Debugging
Views
C/C++ Icons
The table below lists the icons displayed in the C/C++ perspective. Icon Description C or C++ file Class Code template Macro Definition Enum Enumerator Variable Field private Field protected Field public Include Makefile Method private Method protected Method public Namespace Struct Typedef Union Function
Views
C/C++ Menubar
This section describes the menubar options available from the C/C++ perspective. File Menu actions Edit Menu actions Navigate Menu actions Search Menu actions Project Menu actions Run Menu actions Window Menu actions
Function Create a new project, folder, or file. Close the current editor. If the editor contains unsaved data, a save request dialog is shown. Close all editors. If editors contains unsaved data, a save request dialog will be shown. Save the content of the current editor. Disabled if the editor does not contain unsaved changes. Save the content of the current editor under a new name.
Save the content of the current editor. Disabled if no editor contains unsaved changes. Revert the content of the current editor back to the content of the saved file. Disabled if the editor does not contain unsaved changes. Move a resource. Renames a resource.
Ctrl+Shift+S
F2
Refreshes the content of the selected element with the F5 local file system. When launched from no specific selection, this command refreshes all projects. Prints the content of the current editor. Enabled when an editor has the focus. Ctrl+P
Switch workspace... Relaunches Eclipse with a new workspace. Open External File... Opens a file in the editor view. Import Export Properties Exit Opens the Import dialog and shows all import wizards. Opens the Export dialog and shows all export wizards. Opens the property pages of the select elements. Exit Eclipse Alt+Enter
Function Revert the last change in the editor Revert an undone change
Cut
Copies the currently selected text or element to the clipboard and removes the element. On elements, the remove is not performed before the clipboard is pasted. Copies the currently selected text or elements to the clipboard Paste the current content as text to the editor, or as a sibling or child element to the a currently selected element. Delete the current text or element selection. Select all the editor content.. Open the Find / Replace dialog. Editor only. Finds the next occurrence of the currently selected text. Editor only. Finds the previous occurrence of the currently selected text. Editor only. Starts the incremental find mode. After invocation, enter the search text as instructed in the status bar. Editor only.
Ctrl+X
Copy Paste
Ctrl+C
Find Previous
Ctrl+Shift+K
Ctrl+J
Starts the incremental find mode. After invocation, Incremental Find Previous enter the search text as instructed in the status bar. Editor only. Add Bookmark... Add Task... Shift Right Shift Left Next Problem Previous Problem Add a bookmark to the current text selection or selected element. Add a user defined task to the current text selection or selected element. Shifts text Right. Editor only Shifts text Left. Editor only Moves to the next problem encountered. Navigates to the previous problem encountered. Opens a context assist dialog at the current cursor position to bring up Java code assist proposals and templates. See the Templates preference page for available templates Window > Preferences > C/C+ + > Code Templates and go to the Editor preference page Window > Preferences > C/C++ > C/C++ Editor > Content Assist for configuring the behaviour of content assist.
Ctrl+Shift+J
Content Assist
Ctrl+Space
Toggles line delimeters to q CRLF (Windows) Convert Line Delimiters to q LF (UNIX, MacOS X) q CR (Classic MacOS) Encoding Toggles the encoding of the currently shown text content.
Note: Other Edit options are used with the JDT. Refer to the Java Development User Guide for details.
Name Go Into Go To
Keyboard Shortcut
Back: This command displays the hierarchy that was displayed immediately prior to the current display. For example, if you Go Into a resource, then the Back command in the resulting display returns the view to the same hierarchy from which you activated the Go Into command. This command is similar to the Back button in an HTML browser. Forward: This command displays the hierarchy that was displayed immediately after the current display. For example, if you've just selected the Back command, then selecting the Forward command in the resulting display returns the view to the same hierarchy from which you activated the Back command. This command is similar to the Forward button in an HTML browser. Up one level: This command displays the hierarchy of the parent of the current highest-
level resource. Resource: This command allows you to navigate quickly to a resource. For more information see the links to related tasks below.
Open Type
Brings up the Open Type selection dialog to open a type in the editor. The Open Type selection dialog shows all types existing in the workspace. This command displays a dialog that lets you select any resource in the workspace to open it in an editor. This sub-menu is used to find and select the currently selected resource in another view. If an editor is active, these commands are used to select the resource currently being edited in another view. The "next" definition is based on where the focus is. For example, during a search this entry becomes Next Match. The "previous" definition is based on where the focus is. For example, during a search this entry becomes Previous Match.
Ctrl+Shift+T
Ctrl+Shift+R
Ctrl+Shift+W
Next
Ctrl+.
Previous
Go to Last Edit Location Moves the cursor to the line that contains the last edit. Editor only. Go to Line Back Forward Open a dialog where you can specify the line number to which to move the cursor. Editor only. Moves the focus to the previous file. Editor only. Returns the focus from the previous file. Editor only.
Note: Other Navigate options are used with the JDT. Refer to the Java Development User Guide for details.
Files, or for text in files Elements in C/C++ files Text in the online help Plug-ins.
Name
Function
Keyboard Shortcut
C/C++... Opens the search dialog on the C/C++ search page Search... Opens the search dialog for your current editor Ctrl + H File... Opens the search dialog on the File search page
Name Open Project Close Project Build All Build Project Clean
Function Shows a dialog that can be used to select a closed project and open it. Closes the currently selected projects.
Keyboard Shortcut
Builds all projects in the workspace. This is a full build; all files Ctrl+B are built. Builds the currently selected project. This is a full build; all files in the project are built. Invokes the make clean defined in the makefile
When checked, the CDT will perform a build whenever a file in Build Automatically a project is saved. You should turn this feature off for very large projects. Create Make Target Build Make Target Creates a target in the Make Targets view. Standard Make only Builds a specific make target defined in your makefile such as make clean or make install. Standard Make only. Displays the Properties dialog. From that dialog you can display the properties of resources in Info, External Tools Builders, C/C++ Build (managed only) File Types, Indexer options, C/C++ Make Project (standard only), C/C++ Project Paths (standard only), Include Paths and Symbols (standard only), and Project References.
Properties
C/C++ compiler
Building a program
Function This command allows you to quickly repeat the most recent launch in run mode.
Debug Last Launched This command allows you to quickly repeat the most recent launch in debug mode. Run History Run As Presents a sub menu of the recent history of launch configurations launched in run mode. Presents a sub menu of registered run launch shortcuts. Launch shortcuts provide support for workbench or active editor selection sensitive launching. This command realizes the launch configuration dialog to manage run mode launch configurations. Presents a sub menu of the recent history of launch configurations launched in debug mode. Presents a sub menu of registered debug launch shortcuts. Launch shortcuts provide support for workbench or active editor selection sensitive launching. This command realizes the launch configuration dialog to manage debug mode launch configurations. Presents a sub menu of links to external run configuration dialogs to manage run mode launch configurations.
Function Window menu commands: This command opens a new perspective in this Workbench window. This preference can be changed in the Window > Preferences > Workbench > Perspectives page. All of the perspectives that are open within the Workbench window are shown on the shortcut bar. The perspectives you will likely want to open are listed first.This list is dependent on the current perspective. From the Other... submenu you can open any perspective. This command displays the selected view in the current perspective. You can configure how views are opened in the Window > Preferences > Workbench > Perspectives page. Views you are likely to want to open are listed first.This list is dependent on the current perspective. From the Other... submenu you can open any view. The views are sorted into categories in the Show View dialog.
Keyboard Shortcut
Open Perspective
Show View
Each perspective includes a predefined set of actions that are accessible from the menu bar and Workbench toolbar. Related actions are grouped into action sets. This command allows you to customize the current perspective by showing or hiding various action sets. Customize Perspective The first three (File > New, Window > Open Perspective, Window > Show View) control which actions appear as top level items in their respective menus. The last category (Other) controls which action sets are visible in the perspective. This command allows you to save the current perspective, creating your own custom perspective. You can open more perspectives of this type using the Window > Open Perspective > Other menu item once you have saved a perspective. This command changes the layout of the current perspective to its original configuration. This command closes the active perspective. This command closes all open perspectives in the Workbench window. This submenu contains shortcut keys for navigating between the views, perspectives, and editors in the Workbench window. q Show System Menu: Shows the menu that is used for resizing, closing or pinning the current view or editor. q Show View Menu: Shows the drop down menu that is available in the toolbar of the active view. q Maximize Active View or Editor: Maximizes the current view or editor to fill the workbench. q Activate Editor: Makes the current editor active. q Next Editor: Activates the next open editor in the list of most recently used editors. q Previous Editor: Activates the previous open editor in the list of most recently used editors. q Next View: Activates the next open view in the list of most recently used views. q Previous View: Activates the previous open view in the list of most recently used views. q Next Perspective: Activates the next open perspective in the list of most recently used perspectives. q Previous Perspective: Activates the previous open perspective in the list of most recently used perspectives.
Save Perspective As
Navigation
Preferences
This command allows you to indicate your preferences for using the Workbench. There are a wide variety of preferences for configuring the appearance of the Workbench and its views, and for customizing the behavior of all tools that are installed in the Workbench. See the C/C++ Page Preference Window section for more details on the CDT preferences.
C/C++ Toolbar
Go to Last Edit Location Returns editor view to the last line edited, if the file that was last edited was closed it will be re-opened. Back Forward Go to Next Problem Navigates back through open files. Navigates forward through open files. Navigates to the next problem marked during the last build attempt.
Go to Previous Problem Navigates to the previous problem marked during the last build attempt.
Target Name Name of the Make Target. Make Target The reference to the make section in your makefile. Use default Select this checkbox to use the default make command. Clear the check box to specify a new make command. Build command If you clear the Use default checkbox type a new make command in this field. Stop on first build error Stops the build when an error occurs. Run all project builders Runs additional project builders such as discovery.
C/C++ Find/Replace
Ctrl+F (or Edit > Find/Replace) displays the Find/Replace dialog. Here you can specify text to search for and optionally text with which to replace it.
The direction (forward or back from the current cursor location) The scope (All for the whole file or Selected Lines to search only within the highlighted area) Whether the search is Case Sensitive or Whole Word. You can also specify whether the search wraps at the end of the file.
If you close the Find/Replace dialog with text in the Find field, you can use Ctrl+K (or Edit > Find Next) or Ctrl+Shift+K (or Edit > Find Previous) to go to the next occurrence of that text. The directions for "Next" and "Previous" are not affected by the Direction setting in the Find/Replace dialog. Note: Wildcards are not currently supported for searches.
Incremental Find
You can also choose Incremental Find from the Find/Replace dialog. With this option selected, each letter you type in the Find field causes the editor focus to move to the first complete occurrence of the text you are typing. You can also use incremental find by pressing Ctrl+J (Edit > Incremental Find). In this case, the text you type appears in the Status Line at the bottom of the Eclipse window. Note: The settings in the Find/Replace dialog do not affect the operation of incremental find in the Status Line.
C/C++ preferences
The C/C++ Preference dialog box allows you to make changes to your C/C++ environment.
Link view selection to active editor Select this checkbox to open an item selected in the Projects view, in the Editor view. Show file members in Project View Select this checkbox to browse your C and C++ file members in the Projects view. Follow #include's when producing the outline view. Select this checkbox to follow all defined #includes when you produce the Outline view. Note: This is not recommended for large projects or large files.
Preferences for customizing the GDB MI. Source Code Locations Modify, add or remove source code locations Editor Set preferences for the C/C++ editor File Types Define which file extensions are linked to specific languages Make Targets Set preferences for make target build settings New Make Projects Set preferences for customizing Make Builder settings Search Set preferences for customizing the Search configuration
Views
Always clear console before building Select this checkbox to clear the console whenever you perform a build. Open console when building Select this checkbox to open the console build when you perform a build. Bring console to top when building (if present) Select this checkbox to bring the build console to the front when you perform a build. Limit console output (#lines) You specify the maximum number of lines that appear in the build console view. Display tab width You can specify the number of spaces for a tab. Output text color You can customize the color of text in the build console. Information message text color You can customize the color of information text messages in the build console.
Error message text color You can customize the color of error text messages in the build console.
Build overview
Views
New Creates a new code template. Edit Edits the code template that is selected in the list. Remove Removes the selected code templates from the list. Import Imports a code template. Export Exports the selected code templates. Export All Exports all templates in the list. Enable All Makes all templates available when you invoke the Content Assist feature. Disable All Makes all templates unavailable when you invoke the Content Assist feature.
Coding aids
Show Full Paths Select this checkbox to show the full path to files and directories. Automatically refresh registers Select this checkbox to refresh registers before debugging. Automatically refresh shared libraries Select this checkbox to refresh links to shared libraries before debugging. Default variable format: Select the default variable format from either Natural, Decimal or Hexidecimal. Default expression format: Select the default expression format from either Natural, Decimal or Hexidecimal. Default register format:
Select the default register format from either Natural, Decimal or Hexidecimal. Maximum number of instructions: Enter the maximum number of disassembly instruction in the field provided.
Debugger timeout (ms) Sets the timout value for the debugger. Launch timeout (ms) Sets the Launch timeout for a debug session.
Add Insert a new source code location. Up Move the currently selected source code location higher in the list. Down Move the currently selected source code location lower in the list. Remove Remove the currently selected souce code location. Search for duplicate source files Searches the source locations for duplicate entries.
General preferences
You can customize the appearance of the C/C++ editor on the General page of the Preferences window.
Displayed tab width Specifies the width of the tab as a number of characters. For example a value of 4, means that the tab width is 4characters wide. Print margin column Specifies the width of the print margin as a number of characters. For example a value of 80 means that the print area is 80-characters wide. Show overview ruler Displays the vertical ruler in the editor view. Show line numbers Displays line numbers in the left margin. Highlight matching brackets When the cursor is beside a bracket, the matching bracket is highlighted. Highlight current line Highlights the line that was last selected.
Show print margin Displays the print margin in the editor. Insert space for tabs Inserts a space instead of a tab character when you press Tab. Use custom caret Select a custom caret (vertical bar icon showing cursor position). Enable thick caret Displays a thicker caret (vertical bar icon showing cursor position). Appearance color options Lists the items for which you can specify a color. Color Changes the color of the item that is selected in the list.
Coding aids
Color preferences
You can customize the appearance of the C/C++ editor on the Colors page of the Preferences window.
System Default Uses the system default for the background color. Custom Changes the background color. Foreground Lists items, such as comments, keywords, and strings, for which you can specify a color. Color Specifies the color in which to display the selected item. Bold Makes the selected item bold.
Coding aids
Search scope for completion proposals You can configure the Content Assist feature to select proposals from items contained only in the current file and included files, or from the current project. Insert single proposals automatically Inserts an element into your code when the Content Assist feature finds only one proposal. Present proposals in alphabetical order Proposals, by default, appear in order of relevance determined by context, scope and prefix. Alternatively, you can configure the Content Assist feature to order its proposals alphabetically. Content Assist parsing timeout (ms)
For very large projects, the Content Assist feature might slow the response of the plug-in as the Content Assist feature parses the project for proposals. This setting stops the Content Assist parse when it reaches the specified threshold. Auto activation Certain predefined triggers force the Content Assist feature to activate. You can disable the predefined triggers with these checkboxes. Auto activation delay Specifies the number of milliseconds before Content Assist is activated, in Autoactivation mode. Background for completion proposals Specifies the background color of the Content Assist dialog box. Foreground for completion proposals Specifies the foreground color of the Content Assist dialog box.
Coding aids
Hover preferences
You can customize the appearance of the C/C++ editor hover behavior on the Hovers page of the Preferences window.
Enable editor problem annotation When selected problems found will be highlighted in the editor. Text Hover key modifier preferences: You can select hot-keys to enable alternate hover behavior such as a mouse over while pressing the <Ctrl> key will link to the element's source declaration.
Coding aids
Navigation preferences
Enable the editor hyperlink navigation and then you can use Ctrl+click to jump to the declaration of an item on the C/C++ editor
Enable Hyperlink Navigation Select this checkbox to support hyperlink style navigation for Open Declaration.
Coding aids
New Add a new File Type definition. Remove Remove the currently selected File Type definition.
Coding aids
Build Make target in the background Select this checkbox to perform builds in the background.
Build overview
Views
Use default Select this checkbox to use the default make command. Clear the check box to specify a new make command. Build command If you clear the Use default checkbox type a new make command in this field. Stop on first build error Stops the build when an error occurs. Workbench Build Behavior These settings are what the standard builder will call by default when told to build, rebuild, clean, etc. You can change these so that new projects will use different targets if the defaults are not appropriate. Build on resource save (Auto Build) This defines what the standard builder will call when a file is saved, it is not recommended to enable Auto Build for C/C ++ projects.
Build overview
Project properties
Error Parsers Lists the various error parsers which can be enabled or disabled. Up Moves the selected error parser higher in the list. Down Moves the selected error parser lower in the list. Select All Selects all error parsers. Unselect All Clears all error parsers.
Build overview
Filtering errors
Project properties
Binary Parser Select binary parsers from the list, and changed the order in which they are used. Binary Parser Options If a binary parser has parser options you can define them in this section.
Build overview
Project properties
Automate discovery of paths and symbols Select this checkbox to scan the build output for paths and symbols. Build output parser options This section allows you to select the make build output parser. Generate scanner info command options Select to invoke secondary paths and symbols provider (such as GNU specs). Restore Defaults Returns any changes back to their default setting. Apply Applies any changes.
Enable external search markers Select this checkbox to enable searches in external files. Enable Marker Link Type Select visible or invisible markers. Indexer Timeout: Enter the timeout delay (in milliseconds) in the field provided.
Project Properties
This section describes C/C++ Project Properties. To select project properties, right click a project and select Properties.
CDT projects
C++ Project Properties, Standard, Info C++ Project Properties, Standard, Builders C++ Project Properties, Standard, File Types C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Make Builder C++ Project Properties, Standard, Error Parser C++ Project Properties, Standard, Binary Parser C++ Project Properties, Standard, Discovery Options C++ Project Properties, Standard, Source C++ Project Properties, Standard, Output C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Path Containers C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Builders C++ Project Properties, Managed, Build C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Info Shows project information. Default encoding for text files You can specify an alternate text encoding. Restore Defaults Returns any changes back to their default setting. Apply Applies any changes.
C++ Project Properties, Standard, Info C++ Project Properties, Standard, Builders C++ Project Properties, Standard, File Types C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Make Builder C++ Project Properties, Standard, Error Parser C++ Project Properties, Standard, Binary Parser C++ Project Properties, Standard, Discovery Options
C++ Project Properties, Standard, Source C++ Project Properties, Standard, Output C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Path Containers C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Builders C++ Project Properties, Managed, Build C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Builders Select which Builders to enable. New.. Add a new builder. Import.. Import a builder. Edit.. Edit a builder. Remove Remove a builder. Up Move the currently selected builder higher in the list. Down Move the currently selected builder lower in the list.
C++ Project Properties, Standard, Info C++ Project Properties, Standard, Builders
C++ Project Properties, Standard, File Types C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Make Builder C++ Project Properties, Standard, Error Parser C++ Project Properties, Standard, Binary Parser C++ Project Properties, Standard, Discovery Options C++ Project Properties, Standard, Source C++ Project Properties, Standard, Output C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Path Containers C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Build C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Platform: Select the platform from the list provided. Configurations: Select the build configuration from the list provided. Manage... You can change the make command, make flags, add and remove configurations, and change the name of the build goal. Configuration Settings Edit individual options. Restore Defaults Returns any changes back to their default setting. Apply Applies any changes.
C++ Project Properties, Standard, Info C++ Project Properties, Standard, Builders C++ Project Properties, Standard, File Types
C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Make Builder C++ Project Properties, Standard, Error Parser C++ Project Properties, Standard, Binary Parser C++ Project Properties, Standard, Discovery Options C++ Project Properties, Standard, Source C++ Project Properties, Standard, Output C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Path Containers C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Builders C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Use workspace settings Select this to use the Managed workspace settings. Use Project Settings Select this option to use project settings, or add or remove specific file types. New... Add a new file type. Remove Remove a listed file type. Restore Defaults Returns any changes back to their default setting. Apply Applies any changes.
C++ Project Properties, Standard, Info C++ Project Properties, Standard, Builders C++ Project Properties, Standard, File Types
C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Make Builder C++ Project Properties, Standard, Error Parser C++ Project Properties, Standard, Binary Parser C++ Project Properties, Standard, Discovery Options C++ Project Properties, Standard, Source C++ Project Properties, Standard, Output C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Path Containers C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Builders C++ Project Properties, Managed, Build C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Enable C/C++ Indexing When selected C++ Indexing is enabled for this project. Enable C++ Index problem reporting When selected, any index related errors detected will be reported. Restore Defaults Returns any changes back to their default setting. Apply Applies any changes.
C++ Project Properties, Standard, Info C++ Project Properties, Standard, Builders C++ Project Properties, Standard, File Types C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Make Builder
C++ Project Properties, Standard, Error Parser C++ Project Properties, Standard, Binary Parser C++ Project Properties, Standard, Discovery Options C++ Project Properties, Standard, Source C++ Project Properties, Standard, Output C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Path Containers C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Builders C++ Project Properties, Managed, Build C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Error Parsers Lists the various error parsers which can be enabled or disabled. Up Moves the selected error parser higher in the list. Down Moves the selected error parser lower in the list. Select All Selects all error parsers. Unselect All Clears all error parsers.
Build overview
Filtering errors
C++ Project Properties, Standard, Info C++ Project Properties, Standard, Builders C++ Project Properties, Standard, File Types C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Make Builder C++ Project Properties, Standard, Error Parser C++ Project Properties, Standard, Binary Parser C++ Project Properties, Standard, Discovery Options C++ Project Properties, Standard, Source C++ Project Properties, Standard, Output C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Path Containers C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Builders C++ Project Properties, Managed, Build C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Project References
Binary Parser Select a binary parser from the list. Binary Parser Options If a binary parser has parser options you can define them in this section. Restore Defaults Returns any changes back to their default setting. Apply Applies any changes.
Build overview
C++ Project Properties, Standard, Info C++ Project Properties, Standard, Builders C++ Project Properties, Standard, File Types C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Make Builder C++ Project Properties, Standard, Error Parser C++ Project Properties, Standard, Discovery Options C++ Project Properties, Standard, Source C++ Project Properties, Standard, Output C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Path Containers C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Builders C++ Project Properties, Managed, Build C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Project references for <project>: Select the projects required to build this project.
C++ Project Properties, Standard, Info C++ Project Properties, Standard, Builders C++ Project Properties, Standard, File Types C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Make Builder C++ Project Properties, Standard, Error Parser C++ Project Properties, Standard, Binary Parser C++ Project Properties, Standard, Discovery Options C++ Project Properties, Standard, Source C++ Project Properties, Standard, Output C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Path Containers
C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Builders C++ Project Properties, Managed, Build C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Info Shows project information. Default encoding for text files You can specify an alternate text encoding. Restore Defaults Returns any changes back to their default setting. Apply Applies any changes.
C++ Project Properties, Standard, Builders C++ Project Properties, Standard, File Types C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Make Builder
C++ Project Properties, Standard, Error Parser C++ Project Properties, Standard, Binary Parser C++ Project Properties, Standard, Discovery Options C++ Project Properties, Standard, Source C++ Project Properties, Standard, Output C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Path Containers C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Builders C++ Project Properties, Managed, Build C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Builders Select which Builders to enable. New.. Add a new builder. Import.. Import a builder. Edit.. Edit a builder. Remove Remove a builder. Up Move the currently selected builder higher in the list. Down Move the currently selected builder lower in the list.
C++ Project Properties, Standard, Info C++ Project Properties, Standard, File Types C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Make Builder C++ Project Properties, Standard, Error Parser C++ Project Properties, Standard, Binary Parser C++ Project Properties, Standard, Discovery Options C++ Project Properties, Standard, Source C++ Project Properties, Standard, Output C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Path Containers C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Builders C++ Project Properties, Managed, Build C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Use workspace settings Select this to use the Standard workspace settings. Use Project Settings Select this option to use project settings, or add or remove specific file types. New... Add a new file type. Remove Remove a listed file type. Restore Defaults Returns any changes back to their default setting. Apply Applies any changes.
C++ Project Properties, Standard, Info C++ Project Properties, Standard, Builders C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Make Builder C++ Project Properties, Standard, Error Parser C++ Project Properties, Standard, Binary Parser C++ Project Properties, Standard, Discovery Options C++ Project Properties, Standard, Source C++ Project Properties, Standard, Output C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Path Containers C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Builders C++ Project Properties, Managed, Build C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Add Folder/File... Add a new file or folder to the existing project. Show Inherited Paths Select this to show all paths, including those that were inherited. Add Preprocessor Symbol... Add a new preprocessor symbol. Add External Include Paths... Add a new include path. Add Include Path from Workspace... Add an include path from another project in the workspace. Add Contributed... Add a contributed path or symbol. Edit Edit the currently selected path or symbol. Remove
Remove the currently selected path or symbol. Export Export the currently selected path or symbol to a text file. Down Move the currently selected path or symbol down in the list. Up Move the currently selected path or symbol up in the list.
C++ Project Properties, Standard, Info C++ Project Properties, Standard, Builders C++ Project Properties, Standard, File Types C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Make Builder C++ Project Properties, Standard, Error Parser C++ Project Properties, Standard, Binary Parser C++ Project Properties, Standard, Discovery Options C++ Project Properties, Standard, Source C++ Project Properties, Standard, Output C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Path Containers C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Builders C++ Project Properties, Managed, Build C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Enable C/C++ Indexing When selected C++ Indexing is enabled for this project. Enable C++ Index problem reporting When selected, any index related errors detected will be reported. Restore Defaults Returns any changes back to their default setting. Apply Applies any changes.
C++ Project Properties, Standard, Info C++ Project Properties, Standard, Builders C++ Project Properties, Standard, File Types
C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Make Builder C++ Project Properties, Standard, Error Parser C++ Project Properties, Standard, Binary Parser C++ Project Properties, Standard, Discovery Options C++ Project Properties, Standard, Source C++ Project Properties, Standard, Output C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Path Containers C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Builders C++ Project Properties, Managed, Build C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Use default Select this checkbox to use the default make command. Clear the check box to specify a new make command. Build command If you clear the Use default checkbox type a new make command in this field. Stop on first build error Stops the build when an error occurs. Workbench Build Behavior These settings are what the standard builder will call by default when told to build, rebuild, clean, etc. You can change these so that new projects will use different targets if the defaults are not appropriate. Build on resource save (Auto Build) This defines what the standard builder will call when a file is saved, it is not recommended to enable Auto Build for C/C ++ projects.
Build overview
C++ Project Properties, Standard, Info C++ Project Properties, Standard, Builders C++ Project Properties, Standard, File Types C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Error Parser C++ Project Properties, Standard, Binary Parser C++ Project Properties, Standard, Discovery Options C++ Project Properties, Standard, Source C++ Project Properties, Standard, Output C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Path Containers C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Builders C++ Project Properties, Managed, Build C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Error Parsers Lists the various error parsers which can be enabled or disabled. Up Moves the selected error parser higher in the list. Down Moves the selected error parser lower in the list. Select All Selects all error parsers. Unselect All Clears all error parsers.
Build overview
Filtering errors
C++ Project Properties, Standard, Info C++ Project Properties, Standard, Builders C++ Project Properties, Standard, File Types C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Make Builder C++ Project Properties, Standard, Binary Parser C++ Project Properties, Standard, Discovery Options C++ Project Properties, Standard, Source C++ Project Properties, Standard, Output C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Path Containers C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Builders C++ Project Properties, Managed, Build C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Binary Parser Select a binary parser from the list. Binary Parser Options If a binary parser has parser options you can define them in this section. Restore Defaults Returns any changes back to their default setting. Apply Applies any changes.
Build overview
C++ Project Properties, Standard, Info C++ Project Properties, Standard, Builders C++ Project Properties, Standard, File Types C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Make Builder C++ Project Properties, Standard, Error Parser C++ Project Properties, Standard, Discovery Options C++ Project Properties, Standard, Source C++ Project Properties, Standard, Output C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Path Containers C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Builders C++ Project Properties, Managed, Build C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Automate scanner configuration discovery Select this checkbox to configure the automatic discovery of paths and symbols. Build output parser options Monitors the output of the build to automatically keep the list of include paths and symbols up to date with the makefile. Generate scanner info command options This section allows you to select the scanner info settings. Restore Defaults Returns any changes back to their default setting. Apply Applies any changes.
C++ Project Properties, Standard, Info C++ Project Properties, Standard, Builders
C++ Project Properties, Standard, File Types C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Make Builder C++ Project Properties, Standard, Error Parser C++ Project Properties, Standard, Binary Parser C++ Project Properties, Standard, Source C++ Project Properties, Standard, Output C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Path Containers C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Builders C++ Project Properties, Managed, Build C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Add Folder Add a source folder. Edit.. Edit a source folder. Remove Remove a source folder.
C++ Project Properties, Standard, Info C++ Project Properties, Standard, Builders C++ Project Properties, Standard, File Types C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Make Builder C++ Project Properties, Standard, Error Parser
C++ Project Properties, Standard, Binary Parser C++ Project Properties, Standard, Discovery Options C++ Project Properties, Standard, Output C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Path Containers C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Builders C++ Project Properties, Managed, Build C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Add Folder Add an output folder. Edit.. Edit an output folder. Remove Remove an output folder.
C++ Project Properties, Standard, Info C++ Project Properties, Standard, Builders C++ Project Properties, Standard, File Types C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Make Builder C++ Project Properties, Standard, Error Parser
C++ Project Properties, Standard, Binary Parser C++ Project Properties, Standard, Discovery Options C++ Project Properties, Standard, Source C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Path Containers C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Builders C++ Project Properties, Managed, Build C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Required projects on the build path Selecting a project will include any exported paths and symbols from the selected project. Select All Click to select all projects listed in the Required projects on the build path window. Deselect All Click to deselect all projects listed in the Required projects on the build path window.
C++ Project Properties, Standard, Info C++ Project Properties, Standard, Builders C++ Project Properties, Standard, File Types C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Make Builder C++ Project Properties, Standard, Error Parser
C++ Project Properties, Standard, Binary Parser C++ Project Properties, Standard, Discovery Options C++ Project Properties, Standard, Source C++ Project Properties, Standard, Output C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Path Containers C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Builders C++ Project Properties, Managed, Build C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Add External Library... Add and external library. Add from Workspace... Add a library from a project in your workspace. Add Contributed... Add a contributed library. Edit... Edit the currently selected library. Remove Remove the currently selected library. Export Export the currently selected library to a text file.
C++ Project Properties, Standard, Info C++ Project Properties, Standard, Builders
C++ Project Properties, Standard, File Types C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Make Builder C++ Project Properties, Standard, Error Parser C++ Project Properties, Standard, Binary Parser C++ Project Properties, Standard, Discovery Options C++ Project Properties, Standard, Source C++ Project Properties, Standard, Output C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Path Containers C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Builders C++ Project Properties, Managed, Build C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Add.... Add a new path container. Edit... Edit the currently selected path container. Remove Remove the currently selected path container. Export Export the currently selected path container to a text file.
C++ Project Properties, Standard, Info C++ Project Properties, Standard, Builders C++ Project Properties, Standard, File Types C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Make Builder C++ Project Properties, Standard, Error Parser
C++ Project Properties, Standard, Binary Parser C++ Project Properties, Standard, Discovery Options C++ Project Properties, Standard, Source C++ Project Properties, Standard, Output C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Builders C++ Project Properties, Managed, Build C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Project references for <project>: Select the projects required to build this project.
C++ Project Properties, Standard, Info C++ Project Properties, Standard, Builders C++ Project Properties, Standard, File Types C++ Project Properties, Standard, Include Paths and Symbols C++ Project Properties, Standard, Indexer C++ Project Properties, Standard, Make Builder C++ Project Properties, Standard, Error Parser C++ Project Properties, Standard, Binary Parser C++ Project Properties, Standard, Discovery Options C++ Project Properties, Standard, Source C++ Project Properties, Standard, Output
C++ Project Properties, Standard, Projects C++ Project Properties, Standard, Libraries C++ Project Properties, Standard, Path Containers C++ Project Properties, Standard, Project References C++ Project Properties, Managed, Info C++ Project Properties, Managed, Builders C++ Project Properties, Managed, Build C++ Project Properties, Managed, File Types C++ Project Properties, Managed, Indexer C++ Project Properties, Managed, Error Parser C++ Project Properties, Managed, Project References
Create a Managed Make C Project Create a Standard Make C Project Create a Managed Make C++ Project Create a Standard Make C++ Project
CDT projects
Managed Make, Name Managed Make, Select a Target Managed Make, Referenced Projects Managed Make, Error Parsers Managed Make, C/C++ Indexer Standard Make, Name Standard Make, Referenced Projects Standard Make, Make Builder Standard Make, Error Parsers Standard Make, Binary Parser Standard Make, Discovery Options Standard Make, C/C++ Indexer
Function
Use Default Location When selected the new project will be created in the default workspace location. Location If Use Default Location is not selected, enter the location where the project is to be created.
CDT projects
Managed Make, Referenced Projects Managed Make, Error Parsers Managed Make, C/C++ Indexer Standard Make, Name Standard Make, Referenced Projects Standard Make, Make Builder Standard Make, Error Parsers Standard Make, Binary Parser Standard Make, Discovery Options Standard Make, C/C++ Indexer
Function You can select a build target from the drop down list. Specifies which build configurations will be supported for your project. If selected, all known targets will appear in the Configurations window, by default, the list is filtered so that only targets for the host OS are shown.
CDT projects
New Project Wizard Managed Make, Referenced Projects Managed Make, Error Parsers Managed Make, C/C++ Indexer Standard Make, Name Standard Make, Referenced Projects Standard Make, Make Builder Standard Make, Error Parsers Standard Make, Binary Parser Standard Make, Discovery Options Standard Make, C/C++ Indexer
Name
Function
Error Parsers You can select which Error Parsers to enable from this window. Up Moves the currently selected Error Parser higher in the ordered list. Down Select All Moves the currently selected Error Parser lower in the ordered list. Selects all Error Parsers.
CDT projects
New Project Wizard Managed Make, Select a Target Managed Make, Referenced Projects Managed Make, C/C++ Indexer Standard Make, Name Standard Make, Referenced Projects Standard Make, Make Builder Standard Make, Error Parsers Standard Make, Binary Parser Standard Make, Discovery Options Standard Make, C/C++ Indexer
Enable C++ Index problem reporting When selected, any index related errors detected will be reported.
CDT projects
New Project Wizard Managed Make, Select a Target Managed Make, Referenced Projects Managed Make, Error Parsers Standard Make, Name Standard Make, Referenced Projects Standard Make, Make Builder Standard Make, Error Parsers Standard Make, Binary Parser Standard Make, Discovery Options Standard Make, C/C++ Indexer
Function
Use Default Location When selected the new project will be created in the default workspace location.
Location
If Use Default Location is not selected, enter the location where the project is to be created.
CDT projects
New Project Wizard Managed Make, Select a Target Managed Make, Referenced Projects Managed Make, Error Parsers Managed Make, C/C++ Indexer Standard Make, Referenced Projects Standard Make, Make Builder Standard Make, Error Parsers Standard Make, Binary Parser Standard Make, Discovery Options Standard Make, C/C++ Indexer
Function If you have any other projects in your workspace, you can select them as references for this new C or C++ project.
CDT projects
New Project Wizard Managed Make, Select a Target Managed Make, Referenced Projects Managed Make, Error Parsers Managed Make, C/C++ Indexer Standard Make, Name Standard Make, Make Builder Standard Make, Error Parsers Standard Make, Binary Parser Standard Make, Discovery Options Standard Make, C/C++ Indexer
Build Setting
Controls whether the compiler will Stop On Error or to keep building. If you do not select Stop On Error this will force the compiler to attempt to build all referenced projects even if the current project has errors.
You can specify the behavior of builds predefined by the C/C++ toolkit by Workbench Build Behavior linking them to specific build targets in your makefile. The predefined builds are Auto Build, Incremental Build, Rebuild and, Clean
CDT projects
New Project Wizard Managed Make, Select a Target Managed Make, Referenced Projects Managed Make, Error Parsers Managed Make, C/C++ Indexer Standard Make, Name Standard Make, Referenced Projects Standard Make, Error Parsers Standard Make, Binary Parser Standard Make, Discovery Options Standard Make, C/C++ Indexer
Name
Function
Error Parsers You can select which Error Parsers to enable from this window. Up Moves the currently selected Error Parser higher in the ordered list. Down Select All Moves the currently selected Error Parser lower in the ordered list. Selects all Error Parsers.
CDT projects
New Project Wizard Managed Make, Select a Target Managed Make, Referenced Projects Managed Make, Error Parsers Managed Make, C/C++ Indexer Standard Make, Name Standard Make, Referenced Projects Standard Make, Make Builder Standard Make, Binary Parser Standard Make, Discovery Options Standard Make, C/C++ Indexer
Name
Function
Binary Parser
Binary Parser Options If a binary parser has parser options you can define them in this section.
CDT projects
New Project Wizard Managed Make, Select a Target Managed Make, Referenced Projects Managed Make, Error Parsers Managed Make, C/C++ Indexer Standard Make, Name Standard Make, Referenced Projects Standard Make, Make Builder Standard Make, Error Parsers Standard Make, Discovery Options Standard Make, C/C++ Indexer
Name
Function
Automate scanner configuration discovery Build output parser options Generate scanner info command options
Select this checkbox to configure the scanner discovery to run automatically. This section allows you to select the output parser. This section allows you to select the scanner info settings.
CDT projects
New Project Wizard Managed Make, Select a Target Managed Make, Referenced Projects Managed Make, Error Parsers Managed Make, C/C++ Indexer Standard Make, Name Standard Make, Referenced Projects Standard Make, Make Builder Standard Make, Error Parsers Standard Make, Binary Parser Standard Make, C/C++ Indexer
Enable C++ Index problem reporting When selected, any index related errors detected will be reported.
CDT projects
New Project Wizard Managed Make, Select a Target Managed Make, Referenced Projects Managed Make, Error Parsers Managed Make, C/C++ Indexer Standard Make, Name Standard Make, Referenced Projects Standard Make, Make Builder Standard Make, Error Parsers Standard Make, Binary Parser Standard Make, Discovery Options
C/C++ search
Search string Specifies a search string. The search functions support the following wildcards: q Use * to represent any series of characters q Use ? to represent any single character q Use \* to find an asterisk character (*) Case sensitive Searches will return results which match capitalization specified in the search string precisely. Search for Specify the types of elements to include in the search: Search for Description
Class/Struct Includes classes and structs in your search. Function Variable Union Method Field Searches for global functions or functions in a namespace (functions that are not members of a class, struct, or union). Searches for variables that are not members of a class, struct, or union. Searches for unions. Searches for methods that are members of a class, struct, or union. Searches for fields that are members of a class, struct, or union.
Enumeration Searches for enumerations. Enumerator Searches for enumerators. Namespace Searches for namespaces. Any Element Includes all elements in the search. Limit to Specify the types of context to search: Limit to Declarations Definitions References Description Limits the search to declarations. Limits the search to definitions (for functions, methods, variables, and fields). Limits the search to references.
All Occurrences Includes declarations, definitions, and references in the search. Scope Choose the scope of the search: Scope Workspace Workings Set Availability Description
all elements Searches in the full workspace all elements Searches in a working set
Selected Resources all elements Searches the project selected in the Projects view
Working sets can be created and used from within the search dialog.