To start developing an application, you create a new project. To create a new project, do the following:
- From the File menu, click New then New Project...
The New Project dialog appears. This dialog displays the set of project types and project templates.
We'll create a project to develop our application in C:
- Select the Standard > Executable project type in the Categories pane.
- Select the A C Executable icon in the Project Templates pane which selects the type of project to add.
- Type Tutorial in the Name edit box, which names the project.
- You can use the Location edit box or the Browse button to locate where you want the project to be created.
- Click Next.
Once created, the project setup wizard prompts you to set some common options for the project.
Here you can customise the project by altering a number of common project properties such as an additional file format to be output when the application is linked and what library support to include if you use printf and scanf. You can change these settings after the project is created using the Project Explorer.
Clicking Next displays the files that will be added to the project.
The Links to system files group shows the links that will be created in the project to CrossStudio system files. As these files are links they will, by default, be shared with other projects so modifying one will effect all projects containing similar links. To prevent accidental modification, these files are created as read-only. Should you wish to modify a shared file without effecting other projects you can do so by importing them into the project first. Importing a shared file will be demonstrated later in this tutorial. Project links are fully explained in Project management.
The Project files group shows the files that will be copied into the project. As these files are copied to the project directory they can be modified without effecting any other project.
If you uncheck an item, that file is not linked to or created in the project. We will leave all items checked for the moment.
Clicking Next displays the configurations that will be added to the project.
Here you can specify the default configurations that will be added to the project. See Project management for more information on project configurations.
Complete the project creation by clicking Finish.
The Project Explorer shows the overall structure of your project. To see the project explorer, do one of the following:
- From the View menu, click Project Explorer.
—or—
- Type Ctrl+Alt+P.
—or—
- Right click the tool bar area.
- From the popup menu, select Project Explorer.
This is what our project looks like in the Project Explorer:
You'll notice that the project name is shown in bold which indicates that it is the active project (and in our case, the only project). If you have more than one project then you can set the active project using the dropdown box on the build tool bar or the context menu of the project explorer.
The files are arranged into two groups:
- Source Files contains the main source files for your application which will typically be header files, C files, and assembly code files. You may want to add files with other extensions or documentation files in HTML format, for instance.
- System Files contains links to source files that are not part of the project, yet are required when the project is built and run. In this case, the system files are crt0.asm which is the C runtime startup written in assembly code. Files which are stored outside of the project’s home directory are shown by a small purple shortcut indicator at the bottom left of the icon, as above.
These folders have nothing to do with directories on disk, they are simply a means to group related files together in the project explorer. You can create new folders and specify filters based on the file extension so that when you add a new file to the project it will be placed in the folder whose filter matches the file extension.