Now that the project is created and set up, it's time to build it. Unfortunately, there are some deliberate errors in the program which we need to correct.

###### Setting the build configuration

The first thing to do is set the active build configuration you want to use. To set the active build configuration, do the following:

- From the Build menu, click Set Active Build Configuration and select ARM RAM Debug. This signifies that we are going to use a build configuration that generates ARM code, will run from RAM and generate code with debug information and no optimisation so that it can be debugged.

###### Building the project

To buld the project, do the following:

- From the Project menu, click Build.

—or—

- On the Build tool bar, click the Build tool button.

—or—

- Type F7.

Alternatively, to build the Tutorial project using a context menu, do the following:

- In the Project Explorer, right click the Tutorial project node.
- Select Build from the context menu.

CrossStudio starts compiling the project files but finishes after detecting an error. The Output Window shows the Build Log which contains the errors found in the project:

###### Correcting compilation and linkage errors

CrossStudio compiled `fact.c` without errors, but `main.c` contains two errors. After compilation, CrossStudio moves the cursor to the line containing the first reported error. As well as this, the line is marked in the gutter and highlighted by underlining it red. (You can change this behaviour using the Environment Options dialog.)

The status bar also updates to indicate two build errors and shows the first error message.

To correct the error, change the return type of `factorial` from `void` to `int` in its prototype.

To move the cursor to the line containing the next error, type F4 or from the Search menu, click Next Location. The cursor is now positioned at the debug_printf statement which is missing a terminating semicolon—add the semicolon to the end of the line. Using F4 again indicates that we have corrected all errors:

Pressing F4 again wraps around and moves the cursor to the first error, and you can use Shift+F4 or Previous Location in the Search menu to move back through errors. Now that the errors are corrected, compile the project again. The build log still shows that we have a problem.

Notice that `fact.c` has not been recompiled because it was compiled correctly before and is up to date. The remaining error is a linkage error. Double click on `fact.c` in the Project Explorer to open it for editing and change the two occurrences of `fact` to `factorial`. Recompile the project—this time, the project compiles correctly: