Building the Project

Basics

Once you have created your source files and configured your project settings, you can build the project by selecting Build Project from the Project menu or from the project context menu. You can also press Ctrl+B to build all open projects in the workspace.

Figure 5.10. Building a project

Building a project


Build Output

The build output (standard output and standard error) is displayed in the Console View as the build progresses. Errors and warnings parsed from the output are displayed in the Problems View. Double-clicking a line in the Problems View will jump to the corresponding source line. Conversely, the Console View is more useful when you want to look at the build messages in their natural order (Problems View is usually sorted), for example when you get a lot of build errors and you want to begin by looking at the first one.

Makefile Generation

When you start the build process, a makefile will be created or refreshed in each folder where makefile creation is configured. After that, make will be invoked with the all target in the folder configured as build root.

Note

During the build process, the makefile will print out only the names of the compiled files. If you want to see the full command line used to compile each file, specify V=1 (verbose on) on the make command line. To add this option, open Project Properties | C/C⁠+⁠+ Build | Behavior (tab) and replace all with all V=1 on the Build target line.

Cleaning the Project

To clean the project, choose Clean... from the Project menu, or Clean Project from the project context menu. This will invoke make with the clean target in the project's build root folder, and also in referenced projects. To only clean the local project and keep referenced projects intact, use Clean Local item from the project context menu (see next section).

Referenced Projects and the Build Process

When you start the build, the IDE will build the referenced projects first. When you clean the project, the IDE will also clean the referenced projects first. This is often inconvenient (especially if your project depends on a large third party project). To avoid cleaning the referenced projects, use Clean Local from the project context menu.

Build Configurations

A project is built using the active build configuration. A project may have several build configurations, where each configuration selects a compiler toolchain, debug or release mode, defines symbols, etc. To set the active build configuration, choose Build Configurations | Set Active from the project context menu.

Figure 5.11. Activating a build configuration

Activating a build configuration


Console View

The Console View displays the output of the build process.

Figure 5.12. Build output in a console

Build output in a console

Problems View

The Problems View contains the errors and warnings generated by the build process. You can browse the problem list and double-click any message to go to the problem location in the source file. NED file and INI file problems are also reported in this view along with C⁠+⁠+ problems. The editors are annotated with these markers, too. Hover over an error marker in the editor window to get the corresponding message as a tooltip.

Figure 5.13. C⁠+⁠+ problems

C⁠+⁠+ problems