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 Add 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 project 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:

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. 

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.