We'll now set up the example project with some files that demonstrate features of the CrossStudio IDE. For this, we will add one pre-prepared file and one new file to the project.

Adding an existing file to a project

To add one of the existing tutorial files to the project:


In response, CrossStudio displays a standard file-locator dialog. Use it to navigate to the CrossStudio installation directory, then to the tutorial folder, where you should select the fact.c file.

Click Open to add the file to the project. The Project Explorer will list fact.c in the Project Items' Source Files folder, with a shortcut arrow because the file is not in the project's home directory. Rather than edit the file in the tutorial directory, we'll put a copy of it into the project's home directory:

The shortcut arrow disappears from the fact.c node, indicating that our working version of that file is now in our Tutorial project's home directory.

We can open a file for editing by double-clicking the node in the Project Explorer. For example, double-clicking fact.c opens it in the code editor:

Removing a file from a project

We don't need the main.c file that was added to the project by the new-project wizard, so we will remove it. Do one of the following:


Adding a new file to a project

Our project isn't complete, because fact.c is only part of an application. To our project we'll add a new C file that will contain the main() function. To add a new file to the project, do the following:




The New File dialog appears.

The dialog box will now look like this:

Click OK to add the new file. Because main.c already exists on disk, you will be asked whether you wish to overwrite the file:

Click Yes to overwrite the file and continue with the tutorial.

CrossStudio opens the new file in the code editor. Rather than type the program from scratch, we'll add it from a file stored on disk. With the new, empty main.c in the foreground:

Your main.c file should now look like this:

Next, we'll set up some project options.