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

Adding an existing file to a project

We will add one of the tutorial files to the project. To add an existing file to the project, do the following:

—or—

—or—

When you've done this, CrossStudio displays a standard file locator dialog. Navigate to the CrossStudio installation directory, then to the tutorial folder, select the fact.c.

Now click OK to add the file to the project. The Project Explorer will show fact.c 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 take a copy of it and put it into the project home directory:

The shortcut arrow disappears from the fact.c node which indicates that the file is now in our home directory.

We can open a file for editing by double clicking the node in the Project Explorer. Double clicking fact.c brings it into the code editor:

Removing a file from a project

We do not need the main.c file that the new project wizard added to the project, so we will remove it. Click main.c in the Project Explorer and do one of the following:

—or—

—or—

Alternatively, to remove main.c from the project using a context menu, do the following:

Adding a new file to a project

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

—or—

—or—

—or—

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 an editor with the new file ready for editing. Rather than type in the program from scratch, we'll add it from a file stored on disk.

Your main.c file should now look like this:

Next, we'll set up some project options.